Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ideadude/0a4473180e52f95efb9d48f93921bb1c to your computer and use it in GitHub Desktop.
Save ideadude/0a4473180e52f95efb9d48f93921bb1c to your computer and use it in GitHub Desktop.
Remove the default the_content filter added to membership level descriptions and confirmation messages in Paid Memberships Pro
/**
* Remove the default the_content filter added to membership level descriptions
* and confirmation messages in PMPro.
* These filters will sometimes cause infinite loop conflicts, e.g. when using
* page builders like Site Origin.
* Add this code to a custom plugin.
*/
function remove_pmpro_level_description_and_confirmation_filters() {
remove_filter( 'the_content', 'pmpro_level_description' );
remove_filter( 'pmpro_level_description', 'pmpro_pmpro_level_description' );
remove_filter( 'the_content', 'pmpro_confirmation_message' );
remove_filter( 'pmpro_confirmation_message', 'pmpro_pmpro_level_description' );
}
add_action( 'init', 'remove_pmpro_level_description_and_confirmation_filters' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment