USharing
开放博客

Update post meta stored within an array

are you trying to use update_post_meta() in order to try update post meta which is stored within an array? Here’s a quick guide on how to do this.

$temp_array = get_post_meta( get_the_ID(), 'your_meta_key', true );
$temp_array['your_sub_meta_key']['your_sub_sub_meta_key'] = 'New value here';
update_post_meta( get_the_ID(), 'your_meta_key', $temp_array );

 

 

赞(0) 打赏
未经允许不得转载:USharing » Update post meta stored within an array

觉得文章有用就打赏一下文章作者

微信扫一扫打赏