Skip to content

Commit

Permalink
Twenty Twenty: Replace wp_date() with date_i18n().
Browse files Browse the repository at this point in the history
Since WordPress 5.3 it is recommended to use `wp_date()` instead of `date_i18n()`. This changeset replaces the function in Twenty Twenty, with a fallback to `date_i18n()` for old versions of WordPress.

For more info, see https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/.

Props sachyya-sachet, joyously, sabernhardt, poena.
Fixes #48589.





git-svn-id: https://develop.svn.wordpress.org/trunk@57301 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Jan 17, 2024
1 parent a4500a1 commit bb1c19f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/wp-content/themes/twentytwenty/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@

<p class="footer-copyright">&copy;
<?php
echo date_i18n(
/* translators: Copyright date format, see https://www.php.net/manual/datetime.format.php */
_x( 'Y', 'copyright date format', 'twentytwenty' )
);
/* translators: Copyright date format, see https://www.php.net/manual/datetime.format.php */
$date_format = _x( 'Y', 'copyright date format', 'twentytwenty' );
if ( function_exists( 'wp_date' ) ) {
echo wp_date( $date_format );
} else {
echo date_i18n( $date_format );
}
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
</p><!-- .footer-copyright -->
Expand Down

0 comments on commit bb1c19f

Please sign in to comment.