Last active
November 8, 2023 09:40
-
-
Save strangerstudios/a9ed75ba4cbbf545644f to your computer and use it in GitHub Desktop.
Tell PMPro to filter the content a bit later.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Tell PMPro to filter the_content a bit later. | |
This will sometimes fix issues where theme or plugin elements (e.g. videos) | |
are not being filtered by PMPro. Note that this sometimes will cause | |
some things (e.g. share links) to be filtered that you don't want to be | |
filtered... and sometimes edits to the theme or a child theme are | |
required to get the desired effect. | |
Add this to your active theme's fucntions.php or a custom plugin. | |
*/ | |
function my_init_change_pmpro_content_filter_priority() | |
{ | |
remove_filter('the_content', 'pmpro_membership_content_filter', 5); | |
add_filter('the_content', 'pmpro_membership_content_filter', 15); | |
} | |
add_action('init', 'my_init_change_pmpro_content_filter_priority'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Filter Members Only Content Later (for Page Builders and Certain Plugin Conflicts)" at Paid Memberships Pro here: https://www.paidmembershipspro.com/filter-members-only-content-later-for-page-builders-and/