AdvancedCustomFields / AdvancedCustomFields/acf
Usage of wp_date which only exists since WP 5.3
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
You are currently using wp_date() in the local JSON diff:
But wp_date() only got introduced in WordPress 5.3 also see (the make post).
So this results in a Fatal Error on any WP<5.3 which I would consider a bug since you currently state that ACF supports WP back until WP 4.7:
https://github.com/AdvancedCustomFields/acf/blob/fd6fbd054972ea4d54d3edc92fe66cf2b713d0ec/readme.txt#L4
If you fix this please also do it for the 5.* branch for which it is probably even more relevant actually since I assume older WP versions will more often also stick with the older ACF.
I know this is for a very, very outdated WP version, but in the light of the recent security issues with ACF I assume plenty of users will do emergency updates on old sites in which case also updating WP at the same time might slow the updates down. And some might even not do the update if they get the feeling that something is broken like this on the recent version. Also this should be quite easy to fix by just using one of the older date functions in WP.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in includes/ajax/class-acf-ajax-local-json-diff.php around lines 80–87, then check readme.txt for the stated WordPress support range. Verify how the local JSON diff handles dates on WordPress versions before 5.3. Done means avoiding the wp_date() fatal error while preserving the diff behavior in both the current and 5.* branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100