-
-
Save andrewlimaza/fd4c2cf5304ffd22947e9e297aa99f55 to your computer and use it in GitHub Desktop.
Remove Paid Memberships Pro content restriction for Google Product Feed
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 | |
/** | |
* Disabled the PMPro content restriction forr WooCommerce GPF plugin. | |
* Add this code to your WordPress site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function disable_pmpro_for_woocommerce_gpf( $content ) { | |
if ( ! is_single() && isset( $_REQUEST['woocommerce_gpf' ] ) && $_REQUEST['woocommerce_gpf'] == 'google' ) { | |
remove_filter('the_content', 'pmpro_membership_content_filter', 5); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'disable_pmpro_for_woocommerce_gpf', 10 ); | |
function my_pmpro_beaver_builder_compatibility() { | |
if ( ! is_single() && isset( $_REQUEST['woocommerce_gpf' ] ) && $_REQUEST['woocommerce_gpf'] == 'google' ) { | |
remove_filter('the_content', 'pmpro_membership_content_filter', 5); | |
remove_filter('the_content', 'pmpro_membership_content_filter', 15); | |
} | |
} | |
add_action( 'init', 'my_pmpro_beaver_builder_compatibility', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment