Make WordPress Core


Ignore:
Timestamp:
05/23/2024 07:37:08 PM (9 months ago)
Author:
ellatrix
Message:

Editor: Update npm packages.

Updates the editor npm packages to latest versions.

See https://github.com/WordPress/wordpress-develop/pull/6612.

Props ellatrix, mukesh27, youknowriad, mamaduka.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/avatar.php

    r57949 r58187  
    88/**
    99 * Renders the `core/avatar` block on the server.
     10 *
     11 * @since 6.0.0
    1012 *
    1113 * @param array    $attributes Block attributes.
     
    3234
    3335    if ( ! isset( $block->context['commentId'] ) ) {
    34         $author_id   = isset( $attributes['userId'] ) ? $attributes['userId'] : get_post_field( 'post_author', $block->context['postId'] );
     36        if ( isset( $attributes['userId'] ) ) {
     37            $author_id = $attributes['userId'];
     38        } elseif ( isset( $block->context['postId'] ) ) {
     39            $author_id = get_post_field( 'post_author', $block->context['postId'] );
     40        } else {
     41            $author_id = get_query_var( 'author' );
     42        }
     43
     44        if ( empty( $author_id ) ) {
     45            return '';
     46        }
     47
    3548        $author_name = get_the_author_meta( 'display_name', $author_id );
    3649        // translators: %s is the Author name.
     
    89102 * the Avatar block.
    90103 *
     104 * @since 6.3.0
     105 *
    91106 * @param array $attributes The block attributes.
    92107 * @return array The border-related classnames and styles for the block.
     
    139154/**
    140155 * Registers the `core/avatar` block on the server.
     156 *
     157 * @since 6.0.0
    141158 */
    142159function register_block_core_avatar() {
Note: See TracChangeset for help on using the changeset viewer.