Make WordPress Core

Changeset 61722


Ignore:
Timestamp:
02/24/2026 02:28:33 AM (5 weeks ago)
Author:
peterwilsoncc
Message:

Editor: Add wp_ prefix real time collaboration option.

Renames the option enable_real_time_collaboration to wp_enable_real_time_collaboration to include the prefix as has been the practice for new options since WordPress 5.8.0.

Props peterwilsoncc, mukesh27, parthvataliya, czarate.
See #64622.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r61702 r61722  
    410410
    411411    $defaults = array(
    412         'siteurl'                         => $guessurl,
    413         'home'                            => $guessurl,
    414         'blogname'                        => __( 'My Site' ),
    415         'blogdescription'                 => '',
    416         'users_can_register'              => 0,
    417         'admin_email'                     => 'you@example.com',
     412        'siteurl'                           => $guessurl,
     413        'home'                              => $guessurl,
     414        'blogname'                          => __( 'My Site' ),
     415        'blogdescription'                   => '',
     416        'users_can_register'                => 0,
     417        'admin_email'                       => 'you@example.com',
    418418        /* translators: Default start of the week. 0 = Sunday, 1 = Monday. */
    419         'start_of_week'                   => _x( '1', 'start of week' ),
    420         'use_balanceTags'                 => 0,
    421         'use_smilies'                     => 1,
    422         'require_name_email'              => 1,
    423         'comments_notify'                 => 1,
    424         'posts_per_rss'                   => 10,
    425         'rss_use_excerpt'                 => 0,
    426         'mailserver_url'                  => 'mail.example.com',
    427         'mailserver_login'                => 'login@example.com',
    428         'mailserver_pass'                 => '',
    429         'mailserver_port'                 => 110,
    430         'default_category'                => 1,
    431         'default_comment_status'          => 'open',
    432         'default_ping_status'             => 'open',
    433         'default_pingback_flag'           => 1,
    434         'posts_per_page'                  => 10,
     419        'start_of_week'                     => _x( '1', 'start of week' ),
     420        'use_balanceTags'                   => 0,
     421        'use_smilies'                       => 1,
     422        'require_name_email'                => 1,
     423        'comments_notify'                   => 1,
     424        'posts_per_rss'                     => 10,
     425        'rss_use_excerpt'                   => 0,
     426        'mailserver_url'                    => 'mail.example.com',
     427        'mailserver_login'                  => 'login@example.com',
     428        'mailserver_pass'                   => '',
     429        'mailserver_port'                   => 110,
     430        'default_category'                  => 1,
     431        'default_comment_status'            => 'open',
     432        'default_ping_status'               => 'open',
     433        'default_pingback_flag'             => 1,
     434        'posts_per_page'                    => 10,
    435435        /* translators: Default date format, see https://www.php.net/manual/datetime.format.php */
    436         'date_format'                     => __( 'F j, Y' ),
     436        'date_format'                       => __( 'F j, Y' ),
    437437        /* translators: Default time format, see https://www.php.net/manual/datetime.format.php */
    438         'time_format'                     => __( 'g:i a' ),
     438        'time_format'                       => __( 'g:i a' ),
    439439        /* translators: Links last updated date format, see https://www.php.net/manual/datetime.format.php */
    440         'links_updated_date_format'       => __( 'F j, Y g:i a' ),
    441         'comment_moderation'              => 0,
    442         'moderation_notify'               => 1,
    443         'permalink_structure'             => '',
    444         'rewrite_rules'                   => '',
    445         'hack_file'                       => 0,
    446         'blog_charset'                    => 'UTF-8',
    447         'moderation_keys'                 => '',
    448         'active_plugins'                  => array(),
    449         'category_base'                   => '',
    450         'ping_sites'                      => 'https://rpc.pingomatic.com/',
    451         'comment_max_links'               => 2,
    452         'gmt_offset'                      => $gmt_offset,
     440        'links_updated_date_format'         => __( 'F j, Y g:i a' ),
     441        'comment_moderation'                => 0,
     442        'moderation_notify'                 => 1,
     443        'permalink_structure'               => '',
     444        'rewrite_rules'                     => '',
     445        'hack_file'                         => 0,
     446        'blog_charset'                      => 'UTF-8',
     447        'moderation_keys'                   => '',
     448        'active_plugins'                    => array(),
     449        'category_base'                     => '',
     450        'ping_sites'                        => 'https://rpc.pingomatic.com/',
     451        'comment_max_links'                 => 2,
     452        'gmt_offset'                        => $gmt_offset,
    453453
    454454        // 1.5.0
    455         'default_email_category'          => 1,
    456         'recently_edited'                 => '',
    457         'template'                        => $template,
    458         'stylesheet'                      => $stylesheet,
    459         'comment_registration'            => 0,
    460         'html_type'                       => 'text/html',
     455        'default_email_category'            => 1,
     456        'recently_edited'                   => '',
     457        'template'                          => $template,
     458        'stylesheet'                        => $stylesheet,
     459        'comment_registration'              => 0,
     460        'html_type'                         => 'text/html',
    461461
    462462        // 1.5.1
    463         'use_trackback'                   => 0,
     463        'use_trackback'                     => 0,
    464464
    465465        // 2.0.0
    466         'default_role'                    => 'subscriber',
    467         'db_version'                      => $wp_db_version,
     466        'default_role'                      => 'subscriber',
     467        'db_version'                        => $wp_db_version,
    468468
    469469        // 2.0.1
    470         'uploads_use_yearmonth_folders'   => 1,
    471         'upload_path'                     => '',
     470        'uploads_use_yearmonth_folders'     => 1,
     471        'upload_path'                       => '',
    472472
    473473        // 2.1.0
    474         'blog_public'                     => '1',
    475         'default_link_category'           => 2,
    476         'show_on_front'                   => 'posts',
     474        'blog_public'                       => '1',
     475        'default_link_category'             => 2,
     476        'show_on_front'                     => 'posts',
    477477
    478478        // 2.2.0
    479         'tag_base'                        => '',
     479        'tag_base'                          => '',
    480480
    481481        // 2.5.0
    482         'show_avatars'                    => '1',
    483         'avatar_rating'                   => 'G',
    484         'upload_url_path'                 => '',
    485         'thumbnail_size_w'                => 150,
    486         'thumbnail_size_h'                => 150,
    487         'thumbnail_crop'                  => 1,
    488         'medium_size_w'                   => 300,
    489         'medium_size_h'                   => 300,
     482        'show_avatars'                      => '1',
     483        'avatar_rating'                     => 'G',
     484        'upload_url_path'                   => '',
     485        'thumbnail_size_w'                  => 150,
     486        'thumbnail_size_h'                  => 150,
     487        'thumbnail_crop'                    => 1,
     488        'medium_size_w'                     => 300,
     489        'medium_size_h'                     => 300,
    490490
    491491        // 2.6.0
    492         'avatar_default'                  => 'mystery',
     492        'avatar_default'                    => 'mystery',
    493493
    494494        // 2.7.0
    495         'large_size_w'                    => 1024,
    496         'large_size_h'                    => 1024,
    497         'image_default_link_type'         => 'none',
    498         'image_default_size'              => '',
    499         'image_default_align'             => '',
    500         'close_comments_for_old_posts'    => 0,
    501         'close_comments_days_old'         => 14,
    502         'thread_comments'                 => 1,
    503         'thread_comments_depth'           => 5,
    504         'page_comments'                   => 0,
    505         'comments_per_page'               => 50,
    506         'default_comments_page'           => 'newest',
    507         'comment_order'                   => 'asc',
    508         'sticky_posts'                    => array(),
    509         'widget_categories'               => array(),
    510         'widget_text'                     => array(),
    511         'widget_rss'                      => array(),
    512         'uninstall_plugins'               => array(),
     495        'large_size_w'                      => 1024,
     496        'large_size_h'                      => 1024,
     497        'image_default_link_type'           => 'none',
     498        'image_default_size'                => '',
     499        'image_default_align'               => '',
     500        'close_comments_for_old_posts'      => 0,
     501        'close_comments_days_old'           => 14,
     502        'thread_comments'                   => 1,
     503        'thread_comments_depth'             => 5,
     504        'page_comments'                     => 0,
     505        'comments_per_page'                 => 50,
     506        'default_comments_page'             => 'newest',
     507        'comment_order'                     => 'asc',
     508        'sticky_posts'                      => array(),
     509        'widget_categories'                 => array(),
     510        'widget_text'                       => array(),
     511        'widget_rss'                        => array(),
     512        'uninstall_plugins'                 => array(),
    513513
    514514        // 2.8.0
    515         'timezone_string'                 => $timezone_string,
     515        'timezone_string'                   => $timezone_string,
    516516
    517517        // 3.0.0
    518         'page_for_posts'                  => 0,
    519         'page_on_front'                   => 0,
     518        'page_for_posts'                    => 0,
     519        'page_on_front'                     => 0,
    520520
    521521        // 3.1.0
    522         'default_post_format'             => 0,
     522        'default_post_format'               => 0,
    523523
    524524        // 3.5.0
    525         'link_manager_enabled'            => 0,
     525        'link_manager_enabled'              => 0,
    526526
    527527        // 4.3.0
    528         'finished_splitting_shared_terms' => 1,
    529         'site_icon'                       => 0,
     528        'finished_splitting_shared_terms'   => 1,
     529        'site_icon'                         => 0,
    530530
    531531        // 4.4.0
    532         'medium_large_size_w'             => 768,
    533         'medium_large_size_h'             => 0,
     532        'medium_large_size_w'               => 768,
     533        'medium_large_size_h'               => 0,
    534534
    535535        // 4.9.6
    536         'wp_page_for_privacy_policy'      => 0,
     536        'wp_page_for_privacy_policy'        => 0,
    537537
    538538        // 4.9.8
    539         'show_comments_cookies_opt_in'    => 1,
     539        'show_comments_cookies_opt_in'      => 1,
    540540
    541541        // 5.3.0
    542         'admin_email_lifespan'            => ( time() + 6 * MONTH_IN_SECONDS ),
     542        'admin_email_lifespan'              => ( time() + 6 * MONTH_IN_SECONDS ),
    543543
    544544        // 5.5.0
    545         'disallowed_keys'                 => '',
    546         'comment_previously_approved'     => 1,
    547         'auto_plugin_theme_update_emails' => array(),
     545        'disallowed_keys'                   => '',
     546        'comment_previously_approved'       => 1,
     547        'auto_plugin_theme_update_emails'   => array(),
    548548
    549549        // 5.6.0
    550         'auto_update_core_dev'            => 'enabled',
    551         'auto_update_core_minor'          => 'enabled',
     550        'auto_update_core_dev'              => 'enabled',
     551        'auto_update_core_minor'            => 'enabled',
    552552        /*
    553553         * Default to enabled for new installs.
    554554         * See https://core.trac.wordpress.org/ticket/51742.
    555555         */
    556         'auto_update_core_major'          => 'enabled',
     556        'auto_update_core_major'            => 'enabled',
    557557
    558558        // 5.8.0
    559         'wp_force_deactivated_plugins'    => array(),
     559        'wp_force_deactivated_plugins'      => array(),
    560560
    561561        // 6.4.0
    562         'wp_attachment_pages_enabled'     => 0,
     562        'wp_attachment_pages_enabled'       => 0,
    563563
    564564        // 6.9.0
    565         'wp_notes_notify'                 => 1,
     565        'wp_notes_notify'                   => 1,
    566566
    567567        // 7.0.0
    568         'enable_real_time_collaboration' => 0,
     568        'wp_enable_real_time_collaboration' => 0,
    569569    );
    570570
  • trunk/src/wp-admin/options-writing.php

    r61689 r61722  
    111111</tr>
    112112<tr>
    113 <th scope="row"><label for="enable_real_time_collaboration"><?php _e( 'Collaboration' ); ?></label></th>
    114 <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>
     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>
    117117</td>
    118118</tr>
  • trunk/src/wp-admin/options.php

    r61689 r61722  
    154154        'default_link_category',
    155155        'default_post_format',
    156         'enable_real_time_collaboration',
     156        'wp_enable_real_time_collaboration',
    157157    ),
    158158);
  • trunk/src/wp-includes/collaboration.php

    r61689 r61722  
    1515 */
    1616function 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',
  • trunk/src/wp-includes/option.php

    r61702 r61722  
    28882888    register_setting(
    28892889        'writing',
    2890         'enable_real_time_collaboration',
     2890        'wp_enable_real_time_collaboration',
    28912891        array(
    28922892            'type'              => 'boolean',
  • trunk/src/wp-includes/post.php

    r61718 r61722  
    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',
     
    86708670    );
    86718671
    8672     if ( get_option( 'enable_real_time_collaboration' ) ) {
     8672    if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
    86738673        register_meta(
    86748674            'post',
  • trunk/src/wp-includes/rest-api.php

    r61689 r61722  
    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 );
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

    r61689 r61722  
    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 ) {
  • trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php

    r61697 r61722  
    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 );
     
    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
     
    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 );
     
    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
     
    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 );
     
    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
     
    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 );
     
    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}
  • trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php

    r61689 r61722  
    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
  • trunk/tests/phpunit/tests/rest-api/rest-sync-server.php

    r61689 r61722  
    1515
    1616    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    17         update_option( 'enable_real_time_collaboration', true );
     17        update_option( 'wp_enable_real_time_collaboration', true );
    1818
    1919        self::$editor_id     = $factory->user->create( array( 'role' => 'editor' ) );
     
    2626        self::delete_user( self::$subscriber_id );
    2727        wp_delete_post( self::$post_id, true );
    28         delete_option( 'enable_real_time_collaboration' );
     28        delete_option( 'wp_enable_real_time_collaboration' );
    2929    }
    3030
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r61703 r61722  
    1113911139                            "required": false
    1114011140                        },
    11141                         "enable_real_time_collaboration": {
     11141                        "wp_enable_real_time_collaboration": {
    1114211142                            "title": "",
    1114311143                            "description": "Enable Real-Time Collaboration",
     
    1464714647    "default_category": 1,
    1464814648    "default_post_format": "0",
    14649     "enable_real_time_collaboration": false,
     14649    "wp_enable_real_time_collaboration": false,
    1465014650    "posts_per_page": 10,
    1465114651    "show_on_front": "posts",
Note: See TracChangeset for help on using the changeset viewer.