Tagged: avatar
OK, I copied some code from the web which created an activity link in the Activity tab. I’ve changed what I can so the submenu appears in the Settings tab instead, but I need to change the ‘screen function’ and the ‘link’ part to point to the Change Image page. Any pointers?
function bpfr_custom_profile_sub_nav() { global $bp; $parent_slug = 'settings'; //Add subnav item bp_core_new_subnav_item( array( 'name' => __( 'Change Photo' ), 'slug' => $parent_slug, 'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/', 'parent_slug' => $parent_slug, 'screen_function' => 'bp_activity_screen_my_activity', 'position' => 60, 'link' => bp_get_activity_directory_permalink(), ) ); } add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' );
Please change your ‘link’ to this
'link' => bp_displayed_user_domain() .bp_get_profile_slug() .'/change-avatar/',
That will do it.
Regards
BrajeshHi Brajesh,
We’re almost there. The link you provided worked (for some reason I had to put it in my functions file, not bp-custom, to make it work), but only when the Profiles tab is displaying because it jumps from the Settings tab to the Profile tab to bring up the image upload window. However I want to hide the Profiles tab altogether with this code:
function vap_remove_buddypress_profile_tabs() { global $bp; // to remove main menu like friends. bp_core_remove_nav_item('profile' ); // to remove sub nav favorites under activity. bp_core_remove_subnav_item('activity', 'favorites'); } add_action( 'bp_setup_nav', 'vap_remove_buddypress_profile_tabs', 999 );
When I remove the Profiles tab Buddypress doesn’t know where to go after clicking ‘change photos’ when in the Settings tab.
You must be logged in to reply to this topic.