AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
835 stars 171 forks source link

Extend local-json.php to save/delete to multiple concurrent local JSON paths (6.1.x) #806

Closed d12r-dev closed 1 year ago

d12r-dev commented 1 year ago

This is the 6.1.x version of my long-standing pull request. The description and discussion there directly apply to this PR.

6.1.x updated the local_json.php file (to work with the new post type/taxonomy JSON files). Apologies, I'm not very versed in the ways of Git, I seem to have rebased my fork slightly too roughly, and now the pull requests are disconnected.

Given that you announced "supporting multiple locations for JSON files for Field Group definitions" in your "2022 Year in Review" blog post, maybe 2023 will be the year my changes finally make it in. One can hope, right?

polevaultweb commented 1 year ago

Thanks for this code, much appreciated. It's high up on our internal tracker. We'll keep you posted!

mattgrshaw commented 1 year ago

Hey @d12r-dev

We just shipped ACF PRO 6.2 Beta 1 with support for multiple JSON save paths. While we went with a slightly different approach, this PR was a great base to work from.

If you get a chance to check it out we'd love to hear your feedback. We'll also make sure to credit you in the release notes in the final release!

d12r-dev commented 1 year ago

Hi @mattgrshaw ,

I see you went with an explicit opt-in approach with a separate filter rather than my "if the file was loaded from location x, it is reasonable to assume it should also be saved back to location x" approach. Fair enough, this way it's absolutely certain noone will be surprised by unexpected functionality. It's easy enough to just hook the treatment for load_json into save_paths and call it a day.

Yay, no more patching of release files! After three years I almost gave up hope. 😅

Thanks for your consideration! Hugely appreciated!