Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bp_core_new_nav_item ‘s screen_function is not working properly

@nicholmikey

Participant

Hello, thanks for the response.

I tried bp_setup_nav and with that the menu item does not even appear. my code is

`

add_action(‘wp’, ‘CubePoints_List_Menu’);
function CubePoints_List_Menu(){

global $bp;
$cubepoint_link = ($bp->displayed_user->id ? $bp->displayed_user->domain : $bp->loggedin_user->domain) . $bp->cubepoint->slug . ‘/’;
global $wp_filter;

bp_core_new_subnav_item( array(
‘name’ =>’test’,
‘slug’ => ‘top_points’,
‘parent_slug’ => $bp->cubepoint->slug,
‘parent_url’ => $cubepoint_link,
‘screen_function’ => ‘top_points_screen’,
‘position’ => 70,
) );
}

function top_points_screen() {
global $bp;

add_action( ‘bp_template_title’, ‘top_points_events_title’ );
add_action( ‘bp_template_content’, ‘top_points_events_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
//bp_core_load_template( apply_filters( ‘bp_em_template_screen_one’, ’em/screen-one’ ) );
}
/***
* The second argument of each of the above add_action() calls is a function that will
* display the corresponding information. The functions are presented below:
*/
function top_points_events_title() {
echo ‘Top Points’;
}

function top_points_events_content() {
global $bp;

?>

hello world

<?php
}
`

With this the menu item shows up, if I hover over it points to the correct place, but when I click it just takes me to the home page. I have tried several variations of this code with no luck.

Skip to toolbar