Changeset 61833
- Timestamp:
- 03/05/2026 12:27:39 AM (7 weeks ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
src/wp-admin/includes/schema.php (modified) (1 diff)
-
src/wp-admin/options-writing.php (modified) (1 diff)
-
src/wp-admin/options.php (modified) (1 diff)
-
src/wp-includes/collaboration.php (modified) (1 diff)
-
src/wp-includes/default-filters.php (modified) (1 diff)
-
src/wp-includes/option.php (modified) (1 diff)
-
src/wp-includes/post.php (modified) (2 diffs)
-
src/wp-includes/rest-api.php (modified) (1 diff)
-
src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php (modified) (1 diff)
-
tests/phpunit/tests/rest-api/rest-autosaves-controller.php (modified) (8 diffs)
-
tests/phpunit/tests/rest-api/rest-settings-controller.php (modified) (1 diff)
-
tests/phpunit/tests/rest-api/rest-sync-server.php (modified) (2 diffs)
-
tests/qunit/fixtures/wp-api-generated.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/schema.php
r61828 r61833 564 564 // 6.9.0 565 565 'wp_notes_notify' => 1, 566 567 // 7.0.0 568 'wp_enable_real_time_collaboration' => 1, 566 569 ); 567 570 -
trunk/src/wp-admin/options-writing.php
r61828 r61833 111 111 </tr> 112 112 <tr> 113 <th scope="row"><label for="wp_ disable_real_time_collaboration"><?php _e( 'Collaboration' ); ?></label></th>114 <td> 115 <input name="wp_ disable_real_time_collaboration" type="checkbox" id="wp_disable_real_time_collaboration" value="1" <?php checked( '1', get_option( 'wp_disable_real_time_collaboration' ) ); ?> />116 <label for="wp_ disable_real_time_collaboration"><?php _e( 'Disable real-time collaboration' ); ?></label>113 <th scope="row"><label for="wp_enable_real_time_collaboration"><?php _e( 'Collaboration' ); ?></label></th> 114 <td> 115 <input name="wp_enable_real_time_collaboration" type="checkbox" id="wp_enable_real_time_collaboration" value="1" <?php checked( '1', get_option( 'wp_enable_real_time_collaboration' ) ); ?> /> 116 <label for="wp_enable_real_time_collaboration"><?php _e( 'Enable real-time collaboration' ); ?></label> 117 117 </td> 118 118 </tr> -
trunk/src/wp-admin/options.php
r61829 r61833 154 154 'default_link_category', 155 155 'default_post_format', 156 'wp_ disable_real_time_collaboration',156 'wp_enable_real_time_collaboration', 157 157 ), 158 158 ); -
trunk/src/wp-includes/collaboration.php
r61828 r61833 15 15 */ 16 16 function wp_collaboration_inject_setting() { 17 if ( ! boolval( get_option( 'wp_disable_real_time_collaboration' )) ) {17 if ( get_option( 'wp_enable_real_time_collaboration' ) ) { 18 18 wp_add_inline_script( 19 19 'wp-core-data', -
trunk/src/wp-includes/default-filters.php
r61707 r61833 486 486 add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' ); 487 487 488 // If the upgrade hasn't run yet, assume link manager is used. 489 add_filter( 'default_option_link_manager_enabled', '__return_true' ); 488 // If the upgrade hasn't run yet, set some default options. 489 add_filter( 'default_option_link_manager_enabled', '__return_true' ); // Assume link manager is used. 490 add_filter( 'default_option_wp_enable_real_time_collaboration', '__return_true' ); // Enable real-time collaboration. 490 491 491 492 // This option no longer exists; tell plugins we always support auto-embedding. -
trunk/src/wp-includes/option.php
r61828 r61833 2888 2888 register_setting( 2889 2889 'writing', 2890 'wp_ disable_real_time_collaboration',2890 'wp_enable_real_time_collaboration', 2891 2891 array( 2892 2892 'type' => 'boolean', 2893 'description' => __( ' Disable real-time collaboration' ),2893 'description' => __( 'Enable Real-Time Collaboration' ), 2894 2894 'sanitize_callback' => 'rest_sanitize_boolean', 2895 2895 'default' => false, -
trunk/src/wp-includes/post.php
r61828 r61833 658 658 ); 659 659 660 if ( ! boolval( get_option( 'wp_disable_real_time_collaboration' )) ) {660 if ( get_option( 'wp_enable_real_time_collaboration' ) ) { 661 661 register_post_type( 662 662 'wp_sync_storage', … … 8672 8672 ); 8673 8673 8674 if ( ! boolval( get_option( 'wp_disable_real_time_collaboration' )) ) {8674 if ( get_option( 'wp_enable_real_time_collaboration' ) ) { 8675 8675 register_meta( 8676 8676 'post', -
trunk/src/wp-includes/rest-api.php
r61828 r61833 431 431 432 432 // Collaboration. 433 if ( ! boolval( get_option( 'wp_disable_real_time_collaboration' )) ) {433 if ( get_option( 'wp_enable_real_time_collaboration' ) ) { 434 434 $sync_storage = new WP_Sync_Post_Meta_Storage(); 435 435 $sync_server = new WP_HTTP_Polling_Sync_Server( $sync_storage ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
r61828 r61833 255 255 * document, which can lead to duplicate inserts or deletions. 256 256 */ 257 $is_collaboration_ disabled = boolval( get_option( 'wp_disable_real_time_collaboration' ));258 259 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && $is_collaboration_disabled ) {257 $is_collaboration_enabled = get_option( 'wp_enable_real_time_collaboration' ); 258 259 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && ! $is_collaboration_enabled ) { 260 260 /* 261 261 * Draft posts for the same author: autosaving updates the post and does not create a revision. -
trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
r61828 r61833 571 571 572 572 public function test_rest_autosave_draft_post_same_author() { 573 add_filter( 'pre_option_wp_ disable_real_time_collaboration', '__return_true' );573 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_zero' ); // Zero as false doesn't work for pre-flight options. 574 574 575 575 wp_set_current_user( self::$editor_id ); … … 607 607 608 608 wp_delete_post( $post_id ); 609 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' );610 609 } 611 610 … … 748 747 749 748 public function test_update_item_draft_page_with_parent() { 750 add_filter( 'pre_option_wp_ disable_real_time_collaboration', '__return_true' );749 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_zero' ); // Zero as false doesn't work for pre-flight options. 751 750 752 751 wp_set_current_user( self::$editor_id ); … … 767 766 $this->assertSame( self::$child_draft_page_id, $data['id'] ); 768 767 $this->assertSame( self::$parent_page_id, $data['parent'] ); 769 770 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' );771 768 } 772 769 … … 934 931 */ 935 932 public function test_rest_autosave_draft_post_same_author_with_rtc() { 936 add_filter( 'pre_option_wp_ disable_real_time_collaboration', '__return_false' );933 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' ); 937 934 938 935 wp_set_current_user( self::$editor_id ); … … 973 970 974 971 wp_delete_post( $post_id ); 975 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' );976 972 } 977 973 … … 981 977 */ 982 978 public function test_update_item_draft_page_with_parent_with_rtc() { 983 add_filter( 'pre_option_wp_ disable_real_time_collaboration', '__return_false' );979 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' ); 984 980 985 981 wp_set_current_user( self::$editor_id ); … … 1001 997 $this->assertNotSame( self::$child_draft_page_id, $data['id'] ); 1002 998 $this->assertSame( self::$child_draft_page_id, $data['parent'] ); 1003 1004 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' );1005 999 } 1006 1000 } -
trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php
r61828 r61833 120 120 'default_comment_status', 121 121 'site_icon', // Registered in wp-includes/blocks/site-logo.php 122 'wp_ disable_real_time_collaboration',122 'wp_enable_real_time_collaboration', 123 123 // Connectors API keys are registered in _wp_register_default_connector_settings() in wp-includes/connectors.php. 124 124 'connectors_ai_anthropic_api_key', -
trunk/tests/phpunit/tests/rest-api/rest-sync-server.php
r61828 r61833 15 15 16 16 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 17 add_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' );18 19 17 self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 20 18 self::$subscriber_id = $factory->user->create( array( 'role' => 'subscriber' ) ); … … 26 24 self::delete_user( self::$subscriber_id ); 27 25 wp_delete_post( self::$post_id, true ); 28 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' );29 26 } 30 27 31 28 public function set_up() { 32 29 parent::set_up(); 30 31 // Enable option for tests. 32 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' ); 33 33 34 34 // Reset storage post ID cache to ensure clean state after transaction rollback. -
trunk/tests/qunit/fixtures/wp-api-generated.js
r61828 r61833 11159 11159 "required": false 11160 11160 }, 11161 "wp_ disable_real_time_collaboration": {11161 "wp_enable_real_time_collaboration": { 11162 11162 "title": "", 11163 "description": " Disable real-time collaboration",11163 "description": "Enable Real-Time Collaboration", 11164 11164 "type": "boolean", 11165 11165 "required": false … … 14778 14778 "default_category": 1, 14779 14779 "default_post_format": "0", 14780 "wp_ disable_real_time_collaboration": false,14780 "wp_enable_real_time_collaboration": true, 14781 14781 "posts_per_page": 10, 14782 14782 "show_on_front": "posts",
Note: See TracChangeset
for help on using the changeset viewer.