Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function add_settings_subnav_tab() {
- global $bp;
- // remove profile menu tab
- unset($bp->bp_nav['profile']);
- // add 'Change profile picture' sub-menu tab
- bp_core_new_subnav_item( array(
- 'name' => 'Change Profile Picture',
- 'slug' => 'change-profile-picture',
- 'parent_url' => $bp->loggedin_user->domain . $bp->bp_nav['settings']['slug'] . '/',
- 'parent_slug' => $bp->bp_nav['settings']['slug'],
- 'screen_function' => 'change_profile_picture',
- 'position' => 30
- )
- );
- }
- function change_profile_picture(){
- add_action( 'bp_template_content', 'change_profile_picture_screen_content' );
- bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/plugins' ) );
- xprofile_screen_change_avatar();
- }
- function change_profile_picture_screen_content() {
- bp_get_template_part( 'members/single/profile/change-avatar' );
- }
- add_action( 'bp_setup_nav', 'add_settings_subnav_tab', 100 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement