Reply To: how display content in submenu?
Forgot custom profile menu plugin and use custom code, as it is much simplier.
Here another example, with Swap at the first position on the buddybar on profiles.
function bpfr_swap_luisa_nav() {
global $bp;
$parent_slug = 'swap';
$child_slug = 'swap_sub';
//Add nav item
bp_core_new_nav_item( array(
'name' => __( 'Swap' ),
'slug' => $parent_slug,
'screen_function' => 'bpfr_profile_swap_screen',
'position' => 10, // 10 is the first position on buddybar
'default_subnav_slug' => $child_slug
) );
//Add subnav item
bp_core_new_subnav_item( array(
'name' => __( 'My Swaps' ),
'slug' => $child_slug,
'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/',
'parent_slug' => $parent_slug,
'screen_function' => 'bpfr_profile_swap_screen'
) );
}
function bpfr_profile_swap_screen() {
add_action( 'bp_template_content', 'bpfr_profile_swap_screen_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function bpfr_profile_swap_screen_content() {
do_action( 'my_profile_swap' );
}
add_action( 'bp_setup_nav', 'bpfr_swap_luisa_nav' );
The following function introduce the content related to Swap. As i ignore how that plugin works, i can’t give you a working example for it. It would be nice to indicate the exact plugin name and upload url. Also is it compatible with BP ?
function bpex_swap_stuff() {
?>
<h2>Lorem Ipsum for ever !</h2>
<p>Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.</p>
<?php
}
add_action( 'my_profile_swap', 'bpex_swap_stuff' );