Changeset 58187 for trunk/src/wp-includes/blocks/post-author-biography.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-biography.php
r53157 r58187 9 9 * Renders the `core/post-author-biography` block on the server. 10 10 * 11 * @since 6.0.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_biography( $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 ''; … … 37 40 /** 38 41 * Registers the `core/post-author-biography` block on the server. 42 * 43 * @since 6.0.0 39 44 */ 40 45 function register_block_core_post_author_biography() {
Note: See TracChangeset
for help on using the changeset viewer.