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 greathmaster/6e5e238d7f8219b7768534042d2bdce6 to your computer and use it in GitHub Desktop.
Save greathmaster/6e5e238d7f8219b7768534042d2bdce6 to your computer and use it in GitHub Desktop.
Ensure Paid Memberships Pro compatibility when using the Elementor Page Builder.
<?php
/**
* Ensure Paid Memberships Pro compatibility when using the Elementor Page Builder:
* https://wordpress.org/plugins/elementor/
*
* 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 design your
* Membership Checkout page using Elementor.
*/
function elementor_compatibility_for_pmpro() {
// Remove the default the_content filter added to membership level descriptions and confirmation messages in PMPro.
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', 'elementor_compatibility_for_pmpro' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment