summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/post-author-biography.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
commit0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch)
treee139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/blocks/post-author-biography.php
parentAdding upstream version 6.5.5+dfsg1. (diff)
downloadwordpress-upstream.tar.xz
wordpress-upstream.zip
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/blocks/post-author-biography.php')
-rw-r--r--wp-includes/blocks/post-author-biography.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/wp-includes/blocks/post-author-biography.php b/wp-includes/blocks/post-author-biography.php
index 3ea6ecb..bd983f7 100644
--- a/wp-includes/blocks/post-author-biography.php
+++ b/wp-includes/blocks/post-author-biography.php
@@ -8,17 +8,20 @@
/**
* Renders the `core/post-author-biography` block on the server.
*
+ * @since 6.0.0
+ *
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
* @return string Returns the rendered post author biography block.
*/
function render_block_core_post_author_biography( $attributes, $content, $block ) {
- if ( ! isset( $block->context['postId'] ) ) {
- return '';
+ if ( isset( $block->context['postId'] ) ) {
+ $author_id = get_post_field( 'post_author', $block->context['postId'] );
+ } else {
+ $author_id = get_query_var( 'author' );
}
- $author_id = get_post_field( 'post_author', $block->context['postId'] );
if ( empty( $author_id ) ) {
return '';
}
@@ -36,6 +39,8 @@ function render_block_core_post_author_biography( $attributes, $content, $block
/**
* Registers the `core/post-author-biography` block on the server.
+ *
+ * @since 6.0.0
*/
function register_block_core_post_author_biography() {
register_block_type_from_metadata(