Skip to content

Commit bb1c19f

Browse files
committed
Twenty Twenty: Replace wp_date() with date_i18n().
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
1 parent a4500a1 commit bb1c19f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/wp-content/themes/twentytwenty/footer.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020

2121
<p class="footer-copyright">&copy;
2222
<?php
23-
echo date_i18n(
24-
/* translators: Copyright date format, see https://www.php.net/manual/datetime.format.php */
25-
_x( 'Y', 'copyright date format', 'twentytwenty' )
26-
);
23+
/* translators: Copyright date format, see https://www.php.net/manual/datetime.format.php */
24+
$date_format = _x( 'Y', 'copyright date format', 'twentytwenty' );
25+
if ( function_exists( 'wp_date' ) ) {
26+
echo wp_date( $date_format );
27+
} else {
28+
echo date_i18n( $date_format );
29+
}
2730
?>
2831
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
2932
</p><!-- .footer-copyright -->

0 commit comments

Comments
 (0)