AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
823 stars 168 forks source link

Usage of wp_date which only exists since WP 5.3 #826

Open kraftner opened 1 year ago

kraftner commented 1 year ago

You are currently using wp_date() in the local JSON diff:

https://github.com/AdvancedCustomFields/acf/blob/fd6fbd054972ea4d54d3edc92fe66cf2b713d0ec/includes/ajax/class-acf-ajax-local-json-diff.php#L80-L87

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.