Changeset 58187 for trunk/src/wp-includes/blocks/avatar.php
- Timestamp:
- 05/23/2024 07:37:08 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/avatar.php
r57949 r58187 8 8 /** 9 9 * Renders the `core/avatar` block on the server. 10 * 11 * @since 6.0.0 10 12 * 11 13 * @param array $attributes Block attributes. … … 32 34 33 35 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 35 48 $author_name = get_the_author_meta( 'display_name', $author_id ); 36 49 // translators: %s is the Author name. … … 89 102 * the Avatar block. 90 103 * 104 * @since 6.3.0 105 * 91 106 * @param array $attributes The block attributes. 92 107 * @return array The border-related classnames and styles for the block. … … 139 154 /** 140 155 * Registers the `core/avatar` block on the server. 156 * 157 * @since 6.0.0 141 158 */ 142 159 function register_block_core_avatar() {
Note: See TracChangeset
for help on using the changeset viewer.