Created
March 5, 2021 17:08
-
-
Save ipokkel/38301c0c3b4b95d085ab8ee8c4dca1f3 to your computer and use it in GitHub Desktop.
This recipe improves compatibility for ThemeCo's Cornerstone Editor plugin when editing pages that requires a membership level.
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
<?php | |
/** | |
* This recipe improves compatibility for ThemeCo's Cornerstone Editor plugin | |
* when editing pages that requires a membership level. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_cornerstone_editor_before_load_preview() { | |
if ( defined( 'PMPRO_MEMBER_DIRECTORY_VERSION' ) ) { | |
add_filter( 'pmpro_has_membership_level', '__return_true' ); | |
} | |
} | |
add_action( 'cs_before_preview_frame', 'my_pmpro_cornerstone_editor_before_load_preview' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment