Support

Account

Home Forums General Issues Reimporting ACF select field

Solving

Reimporting ACF select field

  • Hi there,

    I exported some select fields with All Export and the export looks like

    a:2:{s:5:”value”;s:8:”pro_100g”;s:5:”label”;s:9:”pro 100 g”;}

    Now I’m trying to reimport this field/information in a second ACF select field with All Import.

    I presume I have to do some fancy XPath declaration or even write an PHP function, because simply connecting the import’s node child with the existing second ACV field doesn’t do the trick. The second ACF select field is existing and has the same options.

    Any ideas what to do?

    Yours
    Thomas

  • That data structure is the PHP Serialize format, you can use it as is, or decode/encode it using unserialize() and serialize(). as long as your destination field is the same type then the data is just an array of two items, “value” and “label”.

    This is how ACF packs multiple pieces of information into a single db cell when it makes sense for some field types, the equivalent would be JSON encoding.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.