Hi Long,
I don't think this answer quite gets at the problem I was having (which is still unsolved).
What I was trying to say is this. When ajax is turned on, the following no longer works:
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
$reference_post_ID = get_queried_object_id();
$data = [
'reference_post_ID' => $reference_post_ID,
'field_2' => 'value 2',
'field 3' => ['one', 'two', 'three'],
];
\MetaBox\CustomTable\API::update( $post_id, 'my-custom-table', $data );
}, 10, 2 );
The idea is that I want to save the ID of the current post where the form is displayed to the post that is being submitted by the user. That way, I can track which post each submission came from. This works with [mb_frontend_form id="field-group-id" ajax="false"]
but it fails when [mb_frontend_form id="field-group-id" ajax="true"]
Thanks,
Graceson