Update Multiple Post Meta for the Same Post In One update_post_meta call?
How can I update multiple fields/Custom fields for the same post using only one function?
Everything I came across are cases of multiple functions of update_post_meta, for each of the fields.
Is there a way to pass the data using an array, to update multiple post meta values (for the same post) using only one line of “wp_update_post”?
I am trying the following but it doesn’t seem to work, is it even possible to update multiple meta using the “wp_update_post”?
$New_Meta = array ( 'Client_Name' => $Client_Name_Edit, 'Client_Type' => $Client_Type_Edit, ); wp_update_post(array( 'ID' => $Post_ID, 'post_name' => $Client_Name_Edit, 'post_title'=> $Client_Name_Edit, 'meta_input'=> $New_Meta, )); }
Many thanks in advance