I have an existing function which works correctly to update the post status of a parent post (slug='sell-list') when a child CRED action is completed. The code is;
//Change status of parent post when 'Place Order' button is pressed add_action('cred_submit_complete_1298', 'change_parent_status', 10, 2); function change_parent_status($post_id){ $sell_list_id = get_post_meta($post_id, '_wpcf_belongs_sell-list_id', true); if (isset($sell_list_id)) { wp_update_post(array('ID' => $sell_list_id, 'post_status' => 'private')); } }
I also want to update the value of a single line custom field called 'invoice-status' for the same post type 'sell-list'. Can I add this to the same wp_update_post code line above? If yes, could you show me the correct format to use please.
Regards
Robert