Make WordPress Core

Opened 4 years ago

Last modified 8 months ago

#48589 new enhancement

Twenty Twenty: Make use of wp_date instead of date_i18n

Reported by: sachyya-sachet's profile sachyya sachet Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: 2nd-opinion has-patch
Focuses: Cc:

Description

As per the new update, it is not recommended to localize time based on WP timestamp: date_i18n( DATE_RFC3339, $timestamp + $offset )

Rather use new wp_date based on Unix timestamp on Twentytwnety theme footer.php L23

Attachments (1)

48589.diff (1004 bytes) - added by sabernhardt 8 months ago.
check if wp_date() function exists before using it in the theme, or else use date_i18n()

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
4 years ago

  • Summary changed from Make use of wp_date instead of date_i18n on Twentytwnety to Twenty Twenty: Make use of wp_date instead of date_i18n

#2 @joyously
4 years ago

Since wp_date is a new function, it has to be used in a way that is backward compatible. Twenty Twenty is labeled as working with WP 4.7.

#3 @ianbelanger
4 years ago

  • Keywords 2nd-opinion added

@sabernhardt
8 months ago

check if wp_date() function exists before using it in the theme, or else use date_i18n()

#4 @sabernhardt
8 months ago

  • Keywords has-patch added

I added 48589.diff in case that might improve the footer code with more recent WordPress versions.

Note: See TracTickets for help on using tickets.