I have a plugin that is running on all post and pages and I want to remove it from the content on a custom template I created for Thank you pages.
I printed out all the filters that are added to the content and the one I want to reference is as follows
[18de263ad73c07944f622a52d10d6e0ewpsocialite_filter_content] => Array ( [function] => Array ( [0] => wpsocialite Object ( [options:private] => ) [1] => wpsocialite_filter_content ) [accepted_args] => 1 ) )
I have tried many diffrent companations but can't get it right. I would like the final code in my functions.php to look like this
<?php if(is_page_template(thank-you.php)){ remove_filter('the_content', 'wpsocialite_filter_content');}
The main problem is that the filter is being added by Class Object. Here is the code adding it
if (!class_exists("wpsocialite")) {class wpsocialite { public static $instance; private $options; public function WPSocialite() { $this->__construct(); } function __construct() { self::$instance = $this; add_action( 'init', array( $this, 'init' ) ); add_action( 'wp_footer', array( $this, 'wpsocialite_localize_script' ), 20); add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_footer', array( $this, 'admin_footer' ), 20); add_filter( 'body_class', array( $this, 'wpsocialite_body_class' ) ); add_filter( 'the_content', array( $this, 'wpsocialite_filter_content' ) ); add_filter( 'mce_external_plugins', array( $this, 'wpsocialite_shortcode_plugin' ) ); add_filter( 'mce_buttons', array( $this, 'wpsocialite_shortcode_button' ) ); add_filter( 'plugin_action_links', array( $this, 'wpsocialite_settings_link' ), 10, 2 ); add_shortcode( 'wpsocialite', array( $this, 'wpsocialite_shortcode' ) ); if( get_option( 'wpsocialite_excerpt' ) == 1 ){ add_filter( 'the_excerpt', array( $this, 'wpsocialite_filter_content' ) ); } } // __construct
How to reference it to remove it?