From 491532f152b15a26e6ee23113d5cd5bf59a4fc35 Mon Sep 17 00:00:00 2001 From: Tim Howe Date: Fri, 24 May 2024 11:00:48 -0400 Subject: [PATCH 1/2] Removed the if statement the would prevent the post modified date from displaying if it was not past the publish date. --- packages/block-library/src/post-date/index.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/post-date/index.php b/packages/block-library/src/post-date/index.php index bcfff02fc178d7..0f45f394ddfc28 100644 --- a/packages/block-library/src/post-date/index.php +++ b/packages/block-library/src/post-date/index.php @@ -33,17 +33,12 @@ function render_block_core_post_date( $attributes, $content, $block ) { } /* - * If the "Display last modified date" setting is enabled, - * only display the modified date if it is later than the publishing date. + * If the "Display last modified date" setting is enabled. */ if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) { - if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) { - $formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID ); - $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) ); - $classes[] = 'wp-block-post-date__modified-date'; - } else { - return ''; - } + $formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID ); + $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) ); + $classes[] = 'wp-block-post-date__modified-date'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); From 1179167c80101047e7874e6b3452415ce901ec43 Mon Sep 17 00:00:00 2001 From: Tim Howe Date: Fri, 24 May 2024 11:01:42 -0400 Subject: [PATCH 2/2] Updated the help text to reflect more accurately what the Display last modified date will now do. --- packages/block-library/src/post-date/edit.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/block-library/src/post-date/edit.js b/packages/block-library/src/post-date/edit.js index cfb5c572106008..14b28553ff4812 100644 --- a/packages/block-library/src/post-date/edit.js +++ b/packages/block-library/src/post-date/edit.js @@ -181,9 +181,7 @@ export default function PostDateEdit( { } ) } checked={ displayType === 'modified' } - help={ __( - 'Only shows if the post has been modified' - ) } + help={ __( "Show the post's last modified date" ) } />