I have a really newbie question, but I'm really new to WordPress development. In the plugin that I'm using is using this filter.
if ( true === apply_filters( 'some_custom_filter', false ) ) {
return $something;
}
Now I'd like to add_filter
so it will return true
how do I achieve that?
This is what I'm trying but doesn't work it always return false
public function setup_filters() {
add_filter( 'some_custom_filter', array( $this, 'filter_suppress_the_content' ), 10, 3 );
}
public function filter_suppress_the_content() {
return true;
}
This is the class.
private static $instance;
private static $wpcom_related_posts;
public static function get_instance() {
if( ! isset( self::$instance ) ) {
self::$instance = new Klazz;
self::$instance->setup_filters();
}
return self::$instance;
}
public function setup_filters() {
add_filter( 'some_custom_filter', array( $this, 'filter_suppress_the_content' ), 10, 1 );
}
public function filter_suppress_the_content( $false) {
return true;
}