bp_core_new_nav_item in plugin class
-
In a plugin class, I’m successfully creating a new tab on a Member page using:
`bp_core_new_nav_item( array(
‘name’ => __( ‘MyTab’, ‘bp’ ),
‘slug’ => ‘mytab’,
‘position’ => 200,
‘screen_function’ => ‘mytab_screen’,
‘default_subnav_slug’ => ‘mytab’
) );`The problem appears when you click the tab, then this warning appears:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘mytab_screen’ was given in …/wp-includes/plugin.php on line 406
How do I point ‘screen_function’ to a public function in the same class ?
This doesn’t work: `’screen_function’ => $this->mytab_screen()`
(used outside the class but still in the plugin file, everything works)
- The topic ‘bp_core_new_nav_item in plugin class’ is closed to new replies.