Hi,
For example: the field Date Of Birth has the ID date_of_birth
and the field Age has the ID age
, the code to update the field age
after saving the field date_of_birth
should be:
add_action( 'rwmb_date_of_birth_after_save_field', function ( $null, $field, $new, $old, $object_id ) {
// $new is the date_of_birth field value
$age_value = $new; // your function to calculate the age here
update_post_meta( $object_id, 'age', $age_value);
}, 10, 5 );