Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipokkel/38301c0c3b4b95d085ab8ee8c4dca1f3 to your computer and use it in GitHub Desktop.
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.
<?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