Home › Forums › Add-ons › Flexible Content Field › Is it possible to load all layouts on default? › Reply To: Is it possible to load all layouts on default?
I’m not 100% sure, but potentialy you could use the acf/load_value filter to create all the dummy data.
That way, ACF will then render out all the layouts.
This is how I would do it:
1. Read the docs for: http://www.advancedcustomfields.com/resources/filters/acfload_value/
2. Add the filter to you flexible content field and just debug the $value parameter to see how the data is displayed (you may need to edit a post which already contains data)
3. Next step is to modify the $value by adding in a new row of data (make not of the layout attribute for each row which defines the layout)
4. Once you can add an extra blank row, update the function to add 1 of each row type, but only append to the $value if $value is empty (new post)
Hope that helps
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.