Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/21/2014 01:47:10 AM (6 years ago)
Author:
imath
Message:

Does not display change-avatar user nav and screens if WordPress Show avatars setting is disabled

If WordPress discussion Avatar display setting is not activated, then displaying change-avatar user nav and screens is not necessary and might confuse the user as his uploaded avatar will not display.

Fixes #5346

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-loader.php

    r7510 r7747  
    201201
    202202        // Change Avatar
    203         $sub_nav[] = array(
    204             'name'            => __( 'Change Avatar', 'buddypress' ),
    205             'slug'            => 'change-avatar',
    206             'parent_url'      => $profile_link,
    207             'parent_slug'     => $this->slug,
    208             'screen_function' => 'xprofile_screen_change_avatar',
    209             'position'        => 30,
    210             'user_has_access' => bp_core_can_edit_settings()
    211         );
     203        if ( buddypress()->avatar->show_avatars ) {
     204            $sub_nav[] = array(
     205                'name'            => __( 'Change Avatar', 'buddypress' ),
     206                'slug'            => 'change-avatar',
     207                'parent_url'      => $profile_link,
     208                'parent_slug'     => $this->slug,
     209                'screen_function' => 'xprofile_screen_change_avatar',
     210                'position'        => 30,
     211                'user_has_access' => bp_core_can_edit_settings()
     212            );
     213        }
    212214
    213215        parent::setup_nav( $main_nav, $sub_nav );
     
    253255            );
    254256
    255             // Edit Profile
    256             $wp_admin_nav[] = array(
    257                 'parent' => 'my-account-' . $this->id,
    258                 'id'     => 'my-account-' . $this->id . '-change-avatar',
    259                 'title'  => __( 'Change Avatar', 'buddypress' ),
    260                 'href'   => trailingslashit( $profile_link . 'change-avatar' )
    261             );
     257            // Edit Avatar
     258            if ( buddypress()->avatar->show_avatars ) {
     259                $wp_admin_nav[] = array(
     260                    'parent' => 'my-account-' . $this->id,
     261                    'id'     => 'my-account-' . $this->id . '-change-avatar',
     262                    'title'  => __( 'Change Avatar', 'buddypress' ),
     263                    'href'   => trailingslashit( $profile_link . 'change-avatar' )
     264                );
     265            }
    262266
    263267        }
Note: See TracChangeset for help on using the changeset viewer.