Taxonomies: Do not broadcast a taxonomy

This snippet for Broadcast will completely prevent a taxonomy, in this case the “category” taxonomy, from being broadcasted.

The two commented lines of code will either avoid broadcasting any categories, or remove all categories from the child post completely.

add_action( 'threewp_broadcast_broadcasting_started', function( $action )
{
	// If this user is an editor
	if ( ! ThreeWP_Broadcast()->user_has_roles( [ 'editor' ] ) )
		return;

	// Convenience.
	$bcd = $action->broadcasting_data;

	// Uncomment to allow the child post to keep its existing categories.
	// unset( $bcd->parent_post_taxonomies[ 'category' ] );

	// Uncomment to remove all categories from the child.
	// $bcd->parent_post_taxonomies[ 'category' ] = [];
} );