Skip to content

Commit

Permalink
Latest Posts: Use wp_date instead of datetime format (#496)
Browse files Browse the repository at this point in the history
This uses wp_date to allow for localization of the date strings
  • Loading branch information
raikasdev authored Jan 8, 2024
1 parent c88c4d0 commit 6d37a36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mu-plugins/blocks/latest-news/latest-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function render_block( $attributes ) {
$date_element = sprintf(
'<time datetime="%1$s">%2$s</time>',
$date->format( 'c' ),
$date->format( 'F j, Y' )
wp_date( get_option( 'date_format' ), $date->getTimestamp(), null )
);

$list_items .= sprintf(
Expand Down

0 comments on commit 6d37a36

Please sign in to comment.