You could query all the authors and loop through to update their dates. The below query pulls all users who have a programme_id
of the current post_id
and allocates an array of their IDs. You can then loop through to update whatever is necessary:
/** Save Custom Metaboxes **/
function save_custom_meta_boxes( $post_id, $post ) {
/**
* Your Testing conditions should go here to ensure
* That we're in the correct place and actually need to
* run this query. I suggest checking against post type
*/
$user_query = new WP_User_Query( array(
'meta_key' => 'programme_id',
'meta_value'=> $post_id,
'fields' => 'ID',
) );
if( ! empty( $user_query->results ) ) {
foreach( $user_query->results as $user_id ) {
update_user_meta( $user_id, 'programme_end_date', $_POST['some_data_here'] );
}
}
}
add_action( 'save_post', 'save_custom_meta_boxes', 10, 2 );
I kept it as simple as possible and if you have a ton of users this may not be optimal.