Skip to content

Commit

Permalink
Post Date Block: Fix PHP warning error (WordPress#62783)
Browse files Browse the repository at this point in the history
Unlinked contributors: ametaplus.

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ellatrix <[email protected]>
  • Loading branch information
3 people authored Jun 25, 2024
1 parent e1fdffe commit 525f792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-date/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 525f792

Please sign in to comment.