Opened 7 years ago
Closed 3 years ago
#48589 closed enhancement (fixed)
Twenty Twenty: Make use of wp_date instead of date_i18n
| Reported by: | sachyya sachet | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.5 |
| Component: | Bundled Theme | Version: | 5.3 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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)
Change History (8)
#1
@
7 years ago
- Summary Make use of wp_date instead of date_i18n on Twentytwnety → Twenty Twenty: Make use of wp_date instead of date_i18n
@
3 years ago
check if wp_date() function exists before using it in the theme, or else use date_i18n()
#4
@
3 years ago
- Keywords has-patch added
I added 48589.diff in case that might improve the footer code with more recent WordPress versions.
#5
@
3 years ago
- Keywords commit added; 2nd-opinion removed
- Milestone Awaiting Review → 6.5
Test Report
This report validates that the indicated patch works without issues.
Patch tested: https://core.trac.wordpress.org/raw-attachment/ticket/48589/48589.diff
Environment
- OS: macOS 14.2.1
- Web Server: Nginx
- PHP: 5.6.39, 8.0.22
- WordPress: 4.7.26 and 6.4.2.
- Browser: Chrome
- Theme: Twenty Twenty
Actual Results
- ✅ No issues found, the date displays correctly.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Since
wp_dateis 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.