From v6.2, a new hook called acf/json/save_file_name
helps developer customize JSON file name explained here: https://www.advancedcustomfields.com/resources/local-json/#loading-explained
However I found that this hook didn’t work properly, it only applies to creating new JSON files, when I delete the field group, JSON file won’t be deleted.
As you can find in my attached screenshot, ACF delete_file
function still uses the field key to check and delete JSON files which is wrong.
Does anyone try this new hook and have the same issue?
Probably an oversight by the developers, you should contact them or open a ticket in your account. The developers do not monitor these forums and will not see this if you don’t contact them directly.
Thanks for the information. I’ve just submitted a request asking the developers to take a look.
Hey @bichdao-chau, I noticed the same thing. Major bummer this bug exists. Did you hear anything back from the ACF team on when this might be fixed or a workaround?
Hey, thanks for the report here…
I’m looking into this now and I’ll try and get it fixed in a upcoming release.
@creativelogic This is the answer I received from the ACF support.
Hey there,
Unfortunately, this is expected behaviour. You’ll need to manually rename your local JSON files to match the new file structure if you want to apply it to an already build website.
Thanks,
Liam
So I think we can wait for the answer from @lgladdy in an upcoming release to fix this issue. Actually, I didn’t use the hook acf/json/save_file_name
and still using the old json file names because it didn’t work properly.
Hey folks,
We managed to get this fix into 6.3 just before release. Could you confirm it’s working correctly now?
Thanks!
That’s great news @lgladdy! Thank you. In return, I did immediate testing and yes all good from what I can see. Hooray!
@lgladdy Have just run into a related issue with the acf/json/save_file_name
hook, when you rename a field group there is still a json field group left behind with the old name.
For example, if you have a “Group A” field group and rename it “Group B”, you’ll be left with group-a.json
and a group-b.json
.
Agree with @mitchell-dev that there still functions/hooks that need to be added to make this feature working properly.
I decided to spend time testing this feature before applying to my theme code.
@lgladdy Please take into account this one. Many thanks.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.