Change the author during broadcast

This snippet shows how to selectively change the post’s author during broadcasting.

/**
	@brief		Change the author on each blog.
	@since		2020-01-09 06:49:43
**/
function bc_threewp_broadcast_broadcasting_modify_post( $action )
{
	// An array of blog_id => author_id
	$blog_author = [
		100 => 4,
		102 => 12,
	];
	
	// If there is no special author specified for this blog, do not do anything.
	if ( ! isset( $blog_author[ get_current_blog_id() ] ) )
		return;
	
	$action->broadcasting_data
		->modified_post
		->post_author = $blog_author[ get_current_blog_id() ];
}
add_action( 'threewp_broadcast_broadcasting_modify_post', 'bc_threewp_broadcast_broadcasting_modify_post' );