Thank you. I've succeeded saving standard post fields with the following code. However, it doesn't work with custom meta fields. Could you please give me some guidance on how to do that? Tks.
ps: I'm using MB Frontend Submission and MB Custom Table extensions.
Here is the sample code:
add_filter( 'rwmb_frontend_update_post_data', 'zy_before_save_post', 10, 2 );
add_filter( 'rwmb_frontend_insert_post_data', 'zy_before_save_post', 10, 2 );
function zy_before_save_post( $data, $config ) {
$data['post_title'] = "some title"; // okay
$data['post_content'] = "some content"; // okay
$data['my_field_id'] = "some data"; // do not work
$data['meta_input']['my_field_id'] = "some data"; // do not work
return $data;
}