Make WordPress Core


Ignore:
Timestamp:
03/19/2026 07:35:44 AM (8 months ago)
Author:
ellatrix
Message:

Real-time collaboration: change to opt-in (off-by-default).

See: ​https://wordpress.slack.com/archives/C07NVJ51X6K/p1773850504196589.

We are intentionally changing the option name so that it will be off-by-default for everyone, including those that installed a beta release where the feature was on-by-default.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/11289.

Fixes #64845.
Props czarate, peterwilsoncc, jorbin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-sync-server.php

    r61865 r62058  
    1818                self::$subscriber_id = $factory->user->create( array( 'role' => 'subscriber' ) );
    1919                self::$post_id       = $factory->post->create( array( 'post_author' => self::$editor_id ) );
     20
     21                // Enable option in setUpBeforeClass to ensure REST routes are registered.
     22                update_option( 'wp_collaboration_enabled', 1 );
    2023        }
    2124
    … …  
    2326                self::delete_user( self::$editor_id );
    2427                self::delete_user( self::$subscriber_id );
     28                delete_option( 'wp_collaboration_enabled' );
    2529                wp_delete_post( self::$post_id, true );
    2630        }
    … …  
    3034
    3135                // Enable option for tests.
    32                 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' );
     36                update_option( 'wp_collaboration_enabled', 1 );
    3337
    3438                // Reset storage post ID cache to ensure clean state after transaction rollback.
    … …  
    109113                global $wp_rest_server;
    110114
    111                 // Remove the pre_option filter added in ::set_up() so get_option() uses its default logic.
    112                 remove_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' );
    113 
    114115                // Ensure the option is not in the database.
    115                 delete_option( 'wp_enable_real_time_collaboration' );
     116                delete_option( 'wp_collaboration_enabled' );
    116117
    117118                // Reset the REST server so routes are re-registered from scratch.
    … …  
    119120
    120121                $routes = rest_get_server()->get_routes();
    121                 $this->assertArrayHasKey( '/wp-sync/v1/updates', $routes );
     122                $this->assertArrayNotHasKey( '/wp-sync/v1/updates', $routes );
    122123        }
    123124
Note: See TracChangeset for help on using the changeset viewer.