Hi there,
I have a multi select box where currently entries are like key:value
and get printed out on an article page as one string. I want to change them to key : value
which would be printed as value
on the article pages.
What would have to change in the DB in order to keep the selections?
Currently my xy_postmeta > meta_value(s) look like a:2:{i:0;s:11:"key1:value1";i:1;s:11:"key2:value2";}
and I guess I would have to change them to a:2:{i:0;s:6:"value1";i:1;s:6:"value2";}
? What else is there to be updated?
—
Similar to the last question on https://support.advancedcustomfields.com/forums/topic/changing-field-name-question/ – would that be something that could be build into the plugin? If value changes, ask if DB should be updated accordingly?
Thanks
first, you should not make changes directly to serialized data in the database. If you get it wrong you will loose data.
Beyond that, I can’t tell exactly what it is you’re looking at in the database. Is this the field value? If it is this is how ACF is storing the value internally. I would instead look at the field in the ACF editor and alter what the field is returning there and not try to edit the database.
Key/Value store indeed has it’s own surprises. as I bump into php redis extension, the redis servers do provides store key-value and Redis shines when you want to use data structures such as lists, sets, strings, hashes, sorted sets with range queries, geospatial indexes, hyperloglogs, bitmaps, and streams