wp_insert_uses (trac) the following loop to handle meta_input
,
if ( ! empty( $postarr['meta_input'] ) ) {
foreach ( $postarr['meta_input'] as $field => $value ) {
update_post_meta( $post_ID, $field, $value );
}
}
So if you change meta_input
in your new post args to be like this,
'meta_input' => array(
'invocies' => array(
'service' => $_POST['service'],
'price' => $_POST['price'],
'status' => $_POST['status'],
'client' => $_POST['client'],
),
)
I think the data would then get saved correctly.