Skip to content

Commit 4bba68b

Browse files
committed
Add wp prefix to enable_real_time_collaboration option.
1 parent 84e5ace commit 4bba68b

12 files changed

Lines changed: 28 additions & 28 deletions

File tree

src/wp-admin/includes/schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ function populate_options( array $options = array() ) {
565565
'wp_notes_notify' => 1,
566566

567567
// 7.0.0
568-
'enable_real_time_collaboration' => 0,
568+
'wp_enable_real_time_collaboration' => 0,
569569
);
570570

571571
// 3.3.0

src/wp-admin/options-writing.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@
110110
</td>
111111
</tr>
112112
<tr>
113-
<th scope="row"><label for="enable_real_time_collaboration"><?php _e( 'Collaboration' ); ?></label></th>
113+
<th scope="row"><label for="wp_enable_real_time_collaboration"><?php _e( 'Collaboration' ); ?></label></th>
114114
<td>
115-
<input name="enable_real_time_collaboration" type="checkbox" id="enable_real_time_collaboration" value="1" <?php checked( '1', get_option( 'enable_real_time_collaboration' ) ); ?> />
116-
<label for="enable_real_time_collaboration"><?php _e( 'Enable real-time collaboration' ); ?></label>
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>
117117
</td>
118118
</tr>
119119
<?php

src/wp-admin/options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
'default_email_category',
154154
'default_link_category',
155155
'default_post_format',
156-
'enable_real_time_collaboration',
156+
'wp_enable_real_time_collaboration',
157157
),
158158
);
159159
$allowed_options['misc'] = array();

src/wp-includes/collaboration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @access private
1515
*/
1616
function wp_collaboration_inject_setting() {
17-
if ( get_option( 'enable_real_time_collaboration' ) ) {
17+
if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
1818
wp_add_inline_script(
1919
'wp-core-data',
2020
'window._wpCollaborationEnabled = true;',

src/wp-includes/option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2887,7 +2887,7 @@ function register_initial_settings() {
28872887

28882888
register_setting(
28892889
'writing',
2890-
'enable_real_time_collaboration',
2890+
'wp_enable_real_time_collaboration',
28912891
array(
28922892
'type' => 'boolean',
28932893
'description' => __( 'Enable Real-Time Collaboration' ),

src/wp-includes/post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ function create_initial_post_types() {
657657
)
658658
);
659659

660-
if ( get_option( 'enable_real_time_collaboration' ) ) {
660+
if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
661661
register_post_type(
662662
'wp_sync_storage',
663663
array(
@@ -8667,7 +8667,7 @@ function wp_create_initial_post_meta() {
86678667
)
86688668
);
86698669

8670-
if ( get_option( 'enable_real_time_collaboration' ) ) {
8670+
if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
86718671
register_meta(
86728672
'post',
86738673
'_crdt_document',

src/wp-includes/rest-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ function create_initial_rest_routes() {
430430
$icons_controller->register_routes();
431431

432432
// Collaboration.
433-
if ( get_option( 'enable_real_time_collaboration' ) ) {
433+
if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
434434
$sync_storage = new WP_Sync_Post_Meta_Storage();
435435
$sync_server = new WP_HTTP_Polling_Sync_Server( $sync_storage );
436436
$sync_server->register_routes();

src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function create_item( $request ) {
254254
* the saved post. This diff is then applied to the in-memory CRDT
255255
* document, which can lead to duplicate inserts or deletions.
256256
*/
257-
$is_collaboration_enabled = get_option( 'enable_real_time_collaboration' );
257+
$is_collaboration_enabled = get_option( 'wp_enable_real_time_collaboration' );
258258

259259
if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && ! $is_collaboration_enabled ) {
260260
/*

tests/phpunit/tests/rest-api/rest-autosaves-controller.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ public function test_rest_autosave_published_post() {
570570
}
571571

572572
public function test_rest_autosave_draft_post_same_author() {
573-
$original_option = get_option( 'enable_real_time_collaboration' );
574-
update_option( 'enable_real_time_collaboration', false );
573+
$original_option = get_option( 'wp_enable_real_time_collaboration' );
574+
update_option( 'wp_enable_real_time_collaboration', false );
575575

576576
wp_set_current_user( self::$editor_id );
577577

@@ -607,7 +607,7 @@ public function test_rest_autosave_draft_post_same_author() {
607607
$this->assertSame( $post_data['post_excerpt'], $post->post_excerpt );
608608

609609
wp_delete_post( $post_id );
610-
update_option( 'enable_real_time_collaboration', $original_option );
610+
update_option( 'wp_enable_real_time_collaboration', $original_option );
611611
}
612612

613613
public function test_rest_autosave_draft_post_different_author() {
@@ -748,8 +748,8 @@ public function test_get_item_sets_up_postdata() {
748748
}
749749

750750
public function test_update_item_draft_page_with_parent() {
751-
$original_option = get_option( 'enable_real_time_collaboration' );
752-
update_option( 'enable_real_time_collaboration', false );
751+
$original_option = get_option( 'wp_enable_real_time_collaboration' );
752+
update_option( 'wp_enable_real_time_collaboration', false );
753753

754754
wp_set_current_user( self::$editor_id );
755755
$request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$child_draft_page_id . '/autosaves' );
@@ -768,7 +768,7 @@ public function test_update_item_draft_page_with_parent() {
768768

769769
$this->assertSame( self::$child_draft_page_id, $data['id'] );
770770
$this->assertSame( self::$parent_page_id, $data['parent'] );
771-
update_option( 'enable_real_time_collaboration', $original_option );
771+
update_option( 'wp_enable_real_time_collaboration', $original_option );
772772
}
773773

774774
public function test_schema_validation_is_applied() {
@@ -934,8 +934,8 @@ public static function data_head_request_with_specified_fields_returns_success_r
934934
* same author should create a revision instead of updating the post directly.
935935
*/
936936
public function test_rest_autosave_draft_post_same_author_with_rtc() {
937-
$original_option = get_option( 'enable_real_time_collaboration' );
938-
update_option( 'enable_real_time_collaboration', true );
937+
$original_option = get_option( 'wp_enable_real_time_collaboration' );
938+
update_option( 'wp_enable_real_time_collaboration', true );
939939

940940
wp_set_current_user( self::$editor_id );
941941

@@ -974,16 +974,16 @@ public function test_rest_autosave_draft_post_same_author_with_rtc() {
974974
$this->assertSame( $post_data['post_excerpt'], $post->post_excerpt );
975975

976976
wp_delete_post( $post_id );
977-
update_option( 'enable_real_time_collaboration', $original_option );
977+
update_option( 'wp_enable_real_time_collaboration', $original_option );
978978
}
979979

980980
/**
981981
* When real-time collaboration is enabled, autosaving a draft page with
982982
* a parent should create a revision instead of updating the page directly.
983983
*/
984984
public function test_update_item_draft_page_with_parent_with_rtc() {
985-
$original_option = get_option( 'enable_real_time_collaboration' );
986-
update_option( 'enable_real_time_collaboration', true );
985+
$original_option = get_option( 'wp_enable_real_time_collaboration' );
986+
update_option( 'wp_enable_real_time_collaboration', true );
987987

988988
wp_set_current_user( self::$editor_id );
989989
$request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$child_draft_page_id . '/autosaves' );
@@ -1003,6 +1003,6 @@ public function test_update_item_draft_page_with_parent_with_rtc() {
10031003
// With RTC enabled, a revision is created instead of updating the page.
10041004
$this->assertNotSame( self::$child_draft_page_id, $data['id'] );
10051005
$this->assertSame( self::$child_draft_page_id, $data['parent'] );
1006-
update_option( 'enable_real_time_collaboration', $original_option );
1006+
update_option( 'wp_enable_real_time_collaboration', $original_option );
10071007
}
10081008
}

tests/phpunit/tests/rest-api/rest-settings-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function test_get_items() {
119119
'default_ping_status',
120120
'default_comment_status',
121121
'site_icon', // Registered in wp-includes/blocks/site-logo.php
122-
'enable_real_time_collaboration',
122+
'wp_enable_real_time_collaboration',
123123
);
124124

125125
if ( ! is_multisite() ) {

0 commit comments

Comments
 (0)