From 2c939f9b0bf31580754221e55c1c65c904fd4394 Mon Sep 17 00:00:00 2001 From: Paul Kevan Date: Fri, 3 Oct 2025 11:09:15 +0100 Subject: [PATCH] add post_type filter for collaborative editing --- lib/experimental/synchronization.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/experimental/synchronization.php b/lib/experimental/synchronization.php index 029d47c8a365a9..782d5300a1637f 100644 --- a/lib/experimental/synchronization.php +++ b/lib/experimental/synchronization.php @@ -32,7 +32,16 @@ function gutenberg_add_collaborative_editing_post_type_support() { return; } - foreach ( array( 'page', 'post' ) as $post_type ) { + /* + * Filter the post types that support collaborative editing. + * By default, only 'post' and 'page' support it. + * + * @param array $post_types Array of post type names. + * @return array Filtered array of post type names. + */ + $post_types = apply_filters( 'collaborative_editing_post_types', array( 'page', 'post' ) ); + + foreach ( $post_types as $post_type ) { if ( post_type_exists( $post_type ) ) { add_post_type_support( $post_type, 'collaborative-editing' ); }