Hi,
i ran across this code to copy data from a custom field in a group to a custom field outside a group :
add_action( 'rwmb_event-details_after_save_post', function( $object_id ) {
$event = $_POST['event'];
$date = $event['date'];
update_post_meta( $object_id, 'event_date', $date );
} );
I cannot get this to work.
My setup :
A. I have a CPT called 'method'
B. I have setup a group 'test_group'
C. I have a custom text field inside this group called 'data_in_group'
D: I have a custom text field coutside the group 'data_outside_group'
I am using the following code to test if any data gets inserted upon save :
add_action( 'rwmb_method_after_save_post', function( $object_id ) {
$test_insert = '123';
update_post_meta( $object_id, 'data_outside_group', $test_insert );
} );
But this does not work, can you tell me why, what am I doing wrong ?