Skip to content

Commit 62b0651

Browse files
authored
Favorites block: Don't assume that the postID is set, such as through the block renderer. (#701)
1 parent 326254d commit 62b0651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mu-plugins/blocks/favorite-button/render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace WordPressdotorg\MU_Plugins\Favorite_Button_Block;
99

10-
$settings = get_block_settings( $block->context['postId'] );
10+
$settings = get_block_settings( $block->context['postId'] ?? 0 );
1111
if ( ! $settings ) {
1212
return '';
1313
}

0 commit comments

Comments
 (0)