Skip to:
Content

BuddyPress.org

Changeset 9775


Ignore:
Timestamp:
04/20/2015 04:37:57 PM (11 years ago)
Author:
imath
Message:

In wp-admin/extended profile, do not display the avatar metabox if the "Show avatars" WordPress setting is not active.

Fixes #6377

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r9759 r9775  
    691691         */
    692692        public function enqueue_scripts( $screen_id ) {
    693                 if ( ( false === strpos( $screen_id, 'users_page_bp-profile-edit' ) && false === strpos( $screen_id, 'profile_page_bp-profile-edit' ) ) || bp_core_get_root_option( 'bp-disable-avatar-uploads' ) ) {
     693                if ( ( false === strpos( $screen_id, 'users_page_bp-profile-edit' ) && false === strpos( $screen_id, 'profile_page_bp-profile-edit' ) ) || bp_core_get_root_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars ) {
    694694                        return;
    695695                }
     
    769769                }
    770770
    771                 // Avatar Metabox
    772                 add_meta_box(
    773                         'bp_xprofile_user_admin_avatar',
    774                         _x( 'Profile Photo', 'xprofile user-admin edit screen', 'buddypress' ),
    775                         array( $this, 'user_admin_avatar_metabox' ),
    776                         $screen_id,
    777                         'side',
    778                         'low'
    779                 );
     771                if ( buddypress()->avatar->show_avatars ) {
     772                        // Avatar Metabox
     773                        add_meta_box(
     774                                'bp_xprofile_user_admin_avatar',
     775                                _x( 'Profile Photo', 'xprofile user-admin edit screen', 'buddypress' ),
     776                                array( $this, 'user_admin_avatar_metabox' ),
     777                                $screen_id,
     778                                'side',
     779                                'low'
     780                        );
     781                }
    780782        }
    781783
Note: See TracChangeset for help on using the changeset viewer.