Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change profile avatar from the User’s Profile tab to the Settings tab


  • chavodbharat
    Participant

    @chavodbharat

    I am trying to moving the Change profile avatar from the User’s Profile tab to the under Settings tab in buddypress profile section.

    We have done move tab under setting tab but we can not able to do drag and drop functionality as similar like in profile page.

    How i can add drag and drop functionality upload image profile in setting tab.

    Here is my code which is working but not added drag and drop functionality .

    //remove profile menu change-avatar tab
    function bpfr_remove_change_avatar_tab() {
    global $bp;
    bp_core_remove_subnav_item( ‘profile’, ‘change-avatar’ );
    }
    //add_action( ‘bp_ready’, ‘bpfr_remove_change_avatar_tab’, 15 );

    function add_settings_subnav_tab() {
    global $bp;
    // 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’] . ‘/’,
    ‘item_css_id’ => ‘setting_avatar’,
    ‘parent_slug’ => $bp->bp_nav[‘settings’][‘slug’],
    ‘screen_function’ => ‘change_profile_picture’,
    ‘position’ => 30
    )
    );
    }

    function change_profile_picture(){
    xprofile_screen_change_avatar();
    add_action( ‘bp_template_content’, ‘change_profile_picture_screen_content’ );
    return bp_core_load_template( apply_filters( ‘xprofile_template_change_avatar’, ‘members/single/plugins’ ) );
    }

    function change_profile_picture_screen_content() {
    echo ‘<div class=”profile”>’;
    return bp_get_template_part( ‘members/single/profile/change-avatar’ );
    echo ‘</div>’;
    }

    add_action( ‘bp_setup_nav’, ‘add_settings_subnav_tab’, 100 );

  • You must be logged in to reply to this topic.
Skip to toolbar