From 47e3c70a35250e144c3436c5d34e7fed5b7315e7 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Mon, 24 Jun 2024 19:59:52 +0900 Subject: [PATCH] Post Date Block: Fix PHP warning error --- packages/block-library/src/post-date/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/post-date/index.php b/packages/block-library/src/post-date/index.php index 8e778f4e85399..e185a995f6fc2 100644 --- a/packages/block-library/src/post-date/index.php +++ b/packages/block-library/src/post-date/index.php @@ -44,7 +44,7 @@ function render_block_core_post_date( $attributes, $content, $block ) { */ if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) { if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) { - if ( 'human-diff' === $attributes['format'] ) { + if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) { // translators: %s: human-readable time difference. $formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( get_post_timestamp( $post_ID, 'modified' ) ) ); } else {