Support

Account

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?

  • Hi @Asitis

    What do you mean by “the output is serialized”? Perhaps an example would help?

    This is exactly what you need to do:
    1. Read the docs for load_value
    2. Create a filter that will hook into only the flexible content via it’s key
    3. print out it’s $value to understand what it looks like when 1 of each layout has been created (explained in previous comment)
    4. Modify your filter to override the value (if it is empty) to that of which you dumped out previously.

    In short, what you are doing is telling ACF that your flexible content field has a value even when it doesnt. This ‘fake’ or ‘dummy’ value will need to be written by hand, but can be found by first creating the value you want, then using your filter to dump it out so you can see it.

    Thanks
    E