Filter in a class
-
Is it possible to add a filter with a method of a class not a function?
E.g:
<?php class MyClass{ public function __construct(){ add_filter('the_content', '$this->myFilter'); } private function myFilter($content){ return $content; } } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Filter in a class’ is closed to new replies.