Menu tab issue
-
I am trying to add my own menu tab, and have tried several ways to do this from looking around this forum already.
If I do the following:
`bp_core_new_nav_item( array(
‘name’ => __( ‘Media Privacy’, ‘bp-media-privacy’ ),
‘slug’ => ‘media-privacy’,
‘position’ => 80,
‘show_for_displayed_user’ => false,
‘screen_function’ => ‘bp_media_privacy’,
‘default_subnav_slug’ => ‘media-privacy’
) );`That works and I get a tab next to ‘settings’, however when I click the link the page goes to ‘Page not Found’
When trying to put it within a function such as:
`add_action( ‘bp_setup_nav’, ‘Media_Privacy’);
function Media_Privacy(){
bp_core_new_nav_item( array(
‘name’ => __( ‘Media Privacy’, ‘bp-media-privacy’ ),
‘slug’ => ‘media-privacy’,
‘position’ => 80,
‘show_for_displayed_user’ => false,
‘screen_function’ => ‘bp_media_privacy’,
‘default_subnav_slug’ => ‘media-privacy’
) );}
function bp_media_privacy() {
add_action( ‘bp_template_content’, ‘bp_media_privacy_show’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
function bp_media_privacy_show() {
echo ‘testing the page’;
}`
No tab appears and I’m not sure why, this is a clean buddypress test issue and I’ve taken variants of this code from peoples examples online. However this way I cannot get the tab to show, but the other way the tab does nothing anyway?
A little guidance would be appreciated.
Regards,
Versi
- The topic ‘Menu tab issue’ is closed to new replies.