Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Create subnav in profile nav


warut
Participant

@warut

Thanks for reply DJPaul,

just copy from skeleton loader.php and bp_example_core.php

######## loader.php ########

function bp_badge_init() {

require( dirname( __FILE__ ) . ‘/includes/bp-badge-core.php’ );

}

add_action( ‘bp_init’, ‘bp_badge_init’ );

function bp_badge_activate() {

global $wpdb;

}

register_activation_hook( __FILE__, ‘bp_badge_activate’ );

###### bp_example_core.php #######

after activate plugin it call bp_example_core.php

.

.

function bp_badge_setup_nav() {

global $bp;

$badge_link = $bp->loggedin_user->domain . $bp->profile->slug . ‘/’;

bp_core_new_subnav_item( array(

‘name’ => __( ‘screenone’, ‘bp-badge’ ),

‘slug’ => ‘screen-one’,

‘parent_slug’ => $bp->profile->slug,

‘parent_url’ => $badge_link,

‘screen_function’ => ‘bp_badge_screen’,

‘position’ => 10

) );

add_action( ‘wp’, ‘bp_badge_setup_nav’, 2 );

add_action( ‘admin_menu’, ‘bp_badge_setup_nav’, 2 );

######

if i create main nav and setup subnav in it everything ok

Skip to toolbar