How to update serialized post meta?

enter image description here

I have serialized post meta. And i want to update single meta key. It looks like this:

In array:

$kisiArray = array(
   'option1' => 'foo',
   'option2' => 'bar',
   'option3' => 'apple',
   'option4' => 'orange'
);

I want to update only 'option3' to 'peach' so i am using update_post_meta function.

update_post_meta( $post_id, 'themeOps', ??? );

But i don’t know what i must put the meta_value section. When i pust peach, it changes all meta keys to peach.

Read more here:: How to update serialized post meta?

Leave a Reply

Your email address will not be published. Required fields are marked *