Make WordPress Core


Ignore:
Timestamp:
09/22/2024 10:48:04 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Editor: Respect show_avatars option in block editor and Customizer.

This adds checks for the show_avatars option before setting the avatar for post lock modals in the block editor and the Customizer.

Follow-up to [41839], [53070].

Props ffffelix.
Fixes #62081.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r58927 r59078  
    33353335        }
    33363336
    3337         return array(
    3338             'id'     => $lock_user->ID,
    3339             'name'   => $lock_user->display_name,
    3340             'avatar' => get_avatar_url( $lock_user->ID, array( 'size' => 128 ) ),
    3341         );
     3337        $user_details = array(
     3338            'id'   => $lock_user->ID,
     3339            'name' => $lock_user->display_name,
     3340        );
     3341
     3342        if ( get_option( 'show_avatars' ) ) {
     3343            $user_details['avatar'] = get_avatar_url( $lock_user->ID, array( 'size' => 128 ) );
     3344        }
     3345
     3346        return $user_details;
    33423347    }
    33433348
     
    43084313        <script type="text/html" id="tmpl-customize-changeset-locked-notification">
    43094314            <li class="notice notice-{{ data.type || 'info' }} {{ data.containerClasses || '' }}" data-code="{{ data.code }}" data-type="{{ data.type }}">
    4310                 <div class="notification-message customize-changeset-locked-message">
    4311                     <img class="customize-changeset-locked-avatar" src="{{ data.lockUser.avatar }}" alt="{{ data.lockUser.name }}" />
     4315                <div class="notification-message customize-changeset-locked-message {{ data.lockUser.avatar ? 'has-avatar' : '' }}">
     4316                    <# if ( data.lockUser.avatar ) { #>
     4317                        <img class="customize-changeset-locked-avatar" src="{{ data.lockUser.avatar }}" alt="{{ data.lockUser.name }}" />
     4318                    <# } #>
    43124319                    <p class="currently-editing">
    43134320                        <# if ( data.message ) { #>
Note: See TracChangeset for help on using the changeset viewer.