Changeset 58187 for trunk/src/wp-includes/blocks/post-author-name.php
- Timestamp:
- 05/23/2024 07:37:08 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-author-name.php
r55246 r58187 9 9 * Renders the `core/post-author-name` block on the server. 10 10 * 11 * @since 6.2.0 12 * 11 13 * @param array $attributes Block attributes. 12 14 * @param string $content Block default content. … … 15 17 */ 16 18 function render_block_core_post_author_name( $attributes, $content, $block ) { 17 if ( ! isset( $block->context['postId'] ) ) { 18 return ''; 19 if ( isset( $block->context['postId'] ) ) { 20 $author_id = get_post_field( 'post_author', $block->context['postId'] ); 21 } else { 22 $author_id = get_query_var( 'author' ); 19 23 } 20 24 21 $author_id = get_post_field( 'post_author', $block->context['postId'] );22 25 if ( empty( $author_id ) ) { 23 26 return ''; … … 43 46 /** 44 47 * Registers the `core/post-author-name` block on the server. 48 * 49 * @since 6.2.0 45 50 */ 46 51 function register_block_core_post_author_name() {
Note: See TracChangeset
for help on using the changeset viewer.