wp-config.php already contains your database credentials, so I hope people aren’t checking that into public repos, but I guess you never know. Â¯\_(ã)_/Â¯
In my other (non-WP) applications, I use a .env file for sensitive info that doesn’t get checked into version control. I wish WP supported it natively, but here’s a quick tutorial on how to use it: https://m.dotdev.co/secure-your-wordpress-config-with-dotenv-d939fcb06e24
Easy enough if you control the server and can use Composer, otherwise probably not an option.
By the way, if this is being triggered by a WP Migrate DB Pro migration (as is the case for me), the following should prevent the key from being overwritten during a migration: https://gist.github.com/daltonrooney/470619cca87a6c29cb84f92d856b9ec1
As of ACF Pro 5.5.8, the flexible fields clean up after themselves when they are deleted, so no more ghost data in the postmeta table!
I was having this problem as well and reported it to the ACF support team. It looks like it has been fixed in ACF Pro 5.5.8.
That gist actually doesn’t solve the problem for me. For example, ACF is already licensed on my staging site, but when I do a database pull from the production site, the URL no longer matches and the license is invalidated.
A simple DEFINE in wp-config would be a better option in my case, I think!
Is there another field also being saved on the same post with the same name?
I just had a similar problem – I have a group of flexible fields called “image_blocks” that I was cloning into a field called “image_blocks” in another group. I didn’t realize that every time I saved the post, my flexible fields were being overwritten by the parent Clone field.
I would recommend naming the Clone field something like url_clone to avoid collisions, if that’s your problem. It would be great if the plugin could automatically detect confusion like that.
If I’m understanding you correctly, someone has implemented a plugin that does what you’re asking for. It’s called ACF Reusable Field Group: https://github.com/mvpdesign/acf-reusable-field-group
Let’s say you have 2 field groups you want to choose from: FG1 and FG2
Create a 3rd field group (let’s call it Repeater Group) that’s a repeater with a Reusable Field Group field in it. Add the Repeater Group to your pages.
Then, when filling out the page, you would add a row to the Repeater Group Field, select FG1 and fill it out. Add a new row, select FG2, and fill it out. Just watch out for ACF Inception, I think it might be possible to select the Repeater Group itself and create a field within a field within a field. ð
I generally prefer using custom code rather than plugins when trying to accomplish these sorts of things, but I wonder if you’ve heard of Admin Columns Pro? It is insanely cool for doing these sorts of things and has direct ACF integration. I can’t even tell you how much time it has saved me. I have no affiliation with them at all, just passing on some useful info!
Every field has a “class” attribute which can be used to control the styling. (This is in the Pro version of the plugin, I don’t know if this feature has been added to the free version yet.) I have standard classes like “left_half”, “right_half”, and “clear” that I can then style in the admin or on the front end to control the layout.
Here’s a screenshot of the class attribute field, hope that helps.
I did this recently by splitting them up into multiple field groups. The first group is a taxonomy radio field. Then I have several other field groups which are conditional based on the taxonomy of the pgae. Here’s a quick video of what I mean. http://cl.ly/1s302Z3k2p1i
You can call a field with a specific page ID like this:
Where 22 is the ID of your homepage.
Interesting, I am having the same problem. All of my fields disappeared on the edit page! I had to look in “Screen Options” to find them and add them to the page again. Fortunately when I add them back, the setting is saved. I wonder if this is an ACF thing or if something else might be causing this.
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!
© 2020 Advanced Custom Fields. Subscribe