Use in other plugin
-
Hello everybody,
I’m writing my first plugin with WordPress and i want to use ‘If menu’ plugin in mine, how can I declare a new condition directly in my Class ?
For testing i write that in conditions.php :
$conditions[] = array( 'name' => __( 'Test', 'if-menu' ), 'condition' => function($item){ $c = new MyPlugin(); return $c->checkIframe(); } );
I want external that to my class like this :
class MyPlugin{ public function __construct(){ add_filter( 'if_menu_conditions', 'addIfMenu' ); } public function addIfMenu(){ 'name' => __( 'Test', 'if-menu' ), 'condition' => function($item){ self::checkIframe(); } } } new MyPlugin()
But it doesn’t work, can you help me ? I don’t know if i have include somefile or anyelse ?
Thanks a lot ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Use in other plugin’ is closed to new replies.