Skip to content

Commit c94f1d7

Browse files
t-hamanoMamadukajustlevine
authored
Author, Author Name block: fix PHP warning error when there is no context (#69949)
Co-authored-by: t-hamano <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: justlevine <[email protected]>
1 parent e333eab commit c94f1d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/block-library/src/post-author-name/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
2626
return '';
2727
}
2828

29-
if ( ! post_type_supports( $block->context['postType'], 'author' ) ) {
29+
if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
3030
return '';
3131
}
3232

packages/block-library/src/post-author/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function render_block_core_post_author( $attributes, $content, $block ) {
2626
return '';
2727
}
2828

29-
if ( ! post_type_supports( $block->context['postType'], 'author' ) ) {
29+
if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
3030
return '';
3131
}
3232

0 commit comments

Comments
 (0)