Update post content via after_modify_post action

This snippet for Broadcast forces the updating of the post’s content using the broadcasting_after_modify_post action using SQL.

This is sometimes needed when other plugins prevent the updated post content from being written.

function bc_threewp_broadcast_broadcasting_after_modify_post( $action )
	// Use SQL to force modification of the post_content.
	global $wpdb;
	ThreeWP_Broadcast()->debug( 'Forcing update of post_content...' );
	$wpdb->update( $wpdb->posts, [ 'post_content' => $action->broadcasting_data->modified_post->post_content ], [ 'ID' => $action->broadcasting_data->new_post( 'ID' ) ] );
add_action( 'threewp_broadcast_broadcasting_after_modify_post', 'bc_threewp_broadcast_broadcasting_after_modify_post' );