I just made a plugin with some meta data and such. I need to alter the content when, but my add_filter('the_content') doesn't do anything...
Code:
public function run() {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
add_action( 'save_post', array( $this, 'save_post' ) );
// HERE IS MY PROBLEM:
add_filter( 'the_content', array( $this, 'some_content_method' ) );
}
public function some_content_method( $content ) {
var_dump('Why u no?');
$content .= 'Why u no work?';
return $content;
}
If I write 'add_meta_boxes' the dump will work.
// HERE IS MY PROBLEM:
add_filter( 'add_meta_boxes', array( $this, 'some_content_method' ) );
If I change it to add_action instead of add_filter nothing happens either
// HERE IS MY PROBLEM:
add_action( 'the_content', array( $this, 'some_content_method' ) );
everything else works - can anybody help?
run()
get executed?the_content()
function on a front end request and not seeing the filtered content there?