Home Forums Backend Issues (wp-admin) Save flexible content fields to serialized array


Save flexible content fields to serialized array

  • Hi,
    i’m developing a website with 20 static pages, lots of custom post type, lot of content.
    I manage the content with flexible layout fields, containing many fields and subfields.
    I’d like to know if i can save the content of the subfields of my flexible layout field into a serialized array. I’m doing it nicely with repeaters fields but i can’t get it work with flexible content.

    The way with repeater:
    – 1 repeater field
    – containing 1 image field , 1 text field, 1 wysiwyg

    When the post is saved i call
    add_filter(‘acf/update_value/name=my_repeater_field’, ‘or_update_flex_serialize’, 10, 4);
    and it saves all the subfield of my repeater in a serialized array.
    Then in post edit mode, i use load_value to load my content into the corresponding fields.

    When i do the same with flexible content, it doesn’t work, i guess because flexible content is flexible and we have to say ACF there is xx number of text field, xx number of image field, … ?

    Any clue ?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.