Created
July 21, 2018 11:36
-
-
Save kimcoleman/9a89600999da31e13df3fd6de4f11c70 to your computer and use it in GitHub Desktop.
Ensure Paid Memberships Pro compatibility when using Beaver Builder.
This file contains hidden or 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
<?php //Do not copy this PHP tag into your code. | |
/** | |
* Ensure Paid Memberships Pro compatibility when using Beaver Builder: | |
* https://wordpress.org/plugins/beaver-builder-lite-version/ | |
* | |
* Your administrator-level account must have a Membership Level in order to edit all of the pages assigned | |
* under Memberships > Pages. | |
* | |
* You must also set a Custom Field on the Membership Checkout page with the key 'pmpro_default_level' and | |
* value of a level ID in order to properly edit your Membership Checkout page using Beaver Builder. | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function beaver_builder_compatibility_for_pmpro() { | |
if ( defined('PMPRO_VERSION') ) { | |
// Filter members-only content later so that the builder's filters run before PMPro. | |
remove_filter('the_content', 'pmpro_membership_content_filter', 5); | |
add_filter('the_content', 'pmpro_membership_content_filter', 15); | |
} | |
} | |
add_action( 'init', 'beaver_builder_compatibility_for_pmpro' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment