Echo Screen Title On New Profile Nav Tab
-
Thanks to many answers on forums here and blog a came by I have been successful adding a new profile tab I named “funding” which integrates woocoomerce ‘my-account’ page into buddypress. Its working fine yes, but it does not echo that tab tittle ‘Funding Details’.
Below is the code am using…
// Add the funding navigation menu item to BuddyPress' Profile navigation array
add_action( 'bp_setup_nav', 'my_woo_info_nav' );
function my_woo_info_nav() {
global $bp;bp_core_new_nav_item(
array(
'name' => __('Funding', 'buddypress'),
'slug' => 'my-funding',
'parent_url' => $profile_link,
'parent_slug' => $bp->profile->slug,
'default_subnav_slug' => 'my-funding', // We add this submenu item below
'screen_function' => 'bp_woo_profile_subscription_screen',
'position' => 11,
'item_css_id' => 'my-funding'
)
);
}// This is the screen_function used by BuddyPress' navigation
function bp_woo_profile_subscription_screen() {
add_action( 'bp_template_title', 'bp_woo_profile_subscription_screen_title' );
add_action( 'bp_template_content', 'bp_woo_profile_subscription_screen_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}// Echo the screen title
function bp_woo_profile_subscription_screen_title() {
global $bp;
echo 'Funding Details';
}// Add the WooCommerce My Account shortcode to the screen
function bp_woo_profile_subscription_screen_content() {
echo do_shortcode( '[woocommerce_my_account]' );
}I have read through many forums and have done many work arounds but cant find what am doing wrong. The tab screen tittle just wont display on the tab.
Site : https://crowdinfund.com/
Buddypress version: 2.5.1
Wordpress version: 4.4.2
WooCommerce version: 2.5.4I will be happy with help to resolve this issue.
Thanks in advance,
Ike.
- You must be logged in to reply to this topic.