Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ronalfy/44d54b73ed64bc4280028c7481b53e4b to your computer and use it in GitHub Desktop.
Save ronalfy/44d54b73ed64bc4280028c7481b53e4b to your computer and use it in GitHub Desktop.
Remove Paid Memberships Pro content restriction for Google Product Feed
<?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', 4 );
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