Extending – Custom profile tabs
-
Hi,
I have extended buddypress profile by adding some custom profile tabs. Before I was using Version 2.9.4 and it was working just fine. But when I upgrade my plugin to Version 3.1.0, custom tabs are shown but after clicking on it shows 404 page not found.Is it bug or I need to do some changes in code. Please help me. I have followed https://rtmedia.io/docs/developers/create-new-buddypress-profile-tab/ to create custom tabs.
function profile_tab_yourtabname() { global $bp; bp_core_new_nav_item( array( 'name' => 'yourtab', 'slug' => 'yourtab', 'screen_function' => 'yourtab_screen', 'position' => 40, 'parent_url' => bp_loggedin_user_domain() . '/yourtab/', 'parent_slug' => $bp->profile->slug, 'default_subnav_slug' => 'yourtab' ) ); } add_action( 'bp_setup_nav', 'profile_tab_yourtabname' ); function yourtab_screen() { // Add title and content here - last is to call the members plugin.php template. add_action( 'bp_template_title', 'yourtab_title' ); add_action( 'bp_template_content', 'yourtab_content' ); bp_core_load_template( 'buddypress/members/single/plugins' ); } function yourtab_title() { echo 'Title'; } function yourtab_content() { echo 'Content'; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.