Changeset 62058
- Timestamp:
- 03/19/2026 07:35:44 AM (13 days 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) (4 diffs)
-
tests/phpunit/tests/rest-api/rest-settings-controller.php (modified) (1 diff)
-
tests/phpunit/tests/rest-api/rest-sync-server.php (modified) (5 diffs)
-
tests/qunit/fixtures/wp-api-generated.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/schema.php
r61992 r62058 410 410 411 411 $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', 418 418 /* 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, 435 435 /* 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' ), 437 437 /* 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' ), 439 439 /* 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, 453 453 454 454 // 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', 461 461 462 462 // 1.5.1 463 'use_trackback' => 0,463 'use_trackback' => 0, 464 464 465 465 // 2.0.0 466 'default_role' => 'subscriber',467 'db_version' => $wp_db_version,466 'default_role' => 'subscriber', 467 'db_version' => $wp_db_version, 468 468 469 469 // 2.0.1 470 'uploads_use_yearmonth_folders' => 1,471 'upload_path' => '',470 'uploads_use_yearmonth_folders' => 1, 471 'upload_path' => '', 472 472 473 473 // 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', 477 477 478 478 // 2.2.0 479 'tag_base' => '',479 'tag_base' => '', 480 480 481 481 // 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, 490 490 491 491 // 2.6.0 492 'avatar_default' => 'mystery',492 'avatar_default' => 'mystery', 493 493 494 494 // 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(), 513 513 514 514 // 2.8.0 515 'timezone_string' => $timezone_string,515 'timezone_string' => $timezone_string, 516 516 517 517 // 3.0.0 518 'page_for_posts' => 0,519 'page_on_front' => 0,518 'page_for_posts' => 0, 519 'page_on_front' => 0, 520 520 521 521 // 3.1.0 522 'default_post_format' => 0,522 'default_post_format' => 0, 523 523 524 524 // 3.5.0 525 'link_manager_enabled' => 0,525 'link_manager_enabled' => 0, 526 526 527 527 // 4.3.0 528 'finished_splitting_shared_terms' => 1,529 'site_icon' => 0,528 'finished_splitting_shared_terms' => 1, 529 'site_icon' => 0, 530 530 531 531 // 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, 534 534 535 535 // 4.9.6 536 'wp_page_for_privacy_policy' => 0,536 'wp_page_for_privacy_policy' => 0, 537 537 538 538 // 4.9.8 539 'show_comments_cookies_opt_in' => 1,539 'show_comments_cookies_opt_in' => 1, 540 540 541 541 // 5.3.0 542 'admin_email_lifespan' => ( time() + 6 * MONTH_IN_SECONDS ),542 'admin_email_lifespan' => ( time() + 6 * MONTH_IN_SECONDS ), 543 543 544 544 // 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(), 548 548 549 549 // 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', 552 552 /* 553 553 * Default to enabled for new installs. 554 554 * See https://core.trac.wordpress.org/ticket/51742. 555 555 */ 556 'auto_update_core_major' => 'enabled',556 'auto_update_core_major' => 'enabled', 557 557 558 558 // 5.8.0 559 'wp_force_deactivated_plugins' => array(),559 'wp_force_deactivated_plugins' => array(), 560 560 561 561 // 6.4.0 562 'wp_attachment_pages_enabled' => 0,562 'wp_attachment_pages_enabled' => 0, 563 563 564 564 // 6.9.0 565 'wp_notes_notify' => 1,565 'wp_notes_notify' => 1, 566 566 567 567 // 7.0.0 568 'wp_ enable_real_time_collaboration' => 1,568 'wp_collaboration_enabled' => 0, 569 569 ); 570 570 -
trunk/src/wp-admin/options-writing.php
r61833 r62058 111 111 </tr> 112 112 <tr> 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> 113 <th scope="row"><?php _e( 'Collaboration' ); ?></th> 114 <td> 115 <label for="wp_collaboration_enabled"> 116 <input name="wp_collaboration_enabled" type="checkbox" id="wp_collaboration_enabled" value="1" <?php checked( '1', (bool) get_option( 'wp_collaboration_enabled' ) ); ?> /> 117 <?php _e( 'Enable real-time collaboration' ); ?> 118 </label> 117 119 </td> 118 120 </tr> -
trunk/src/wp-admin/options.php
r61833 r62058 154 154 'default_link_category', 155 155 'default_post_format', 156 'wp_ enable_real_time_collaboration',156 'wp_collaboration_enabled', 157 157 ), 158 158 ); -
trunk/src/wp-includes/collaboration.php
r61986 r62058 19 19 global $pagenow; 20 20 21 if ( ! get_option( 'wp_enable_real_time_collaboration' ) ) {21 if ( ! (bool) get_option( 'wp_collaboration_enabled' ) ) { 22 22 return; 23 23 } -
trunk/src/wp-includes/default-filters.php
r62025 r62058 486 486 add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' ); 487 487 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. 488 // If the upgrade hasn't run yet, assume link manager is used. 489 add_filter( 'default_option_link_manager_enabled', '__return_true' ); 491 490 492 491 // This option no longer exists; tell plugins we always support auto-embedding. -
trunk/src/wp-includes/option.php
r61865 r62058 2888 2888 register_setting( 2889 2889 'writing', 2890 'wp_ enable_real_time_collaboration',2890 'wp_collaboration_enabled', 2891 2891 array( 2892 2892 'type' => 'boolean', 2893 2893 'description' => __( 'Enable Real-Time Collaboration' ), 2894 2894 'sanitize_callback' => 'rest_sanitize_boolean', 2895 'default' => true,2895 'default' => false, 2896 2896 'show_in_rest' => true, 2897 2897 ) -
trunk/src/wp-includes/post.php
r62041 r62058 658 658 ); 659 659 660 if ( get_option( 'wp_enable_real_time_collaboration' ) ) {660 if ( (bool) get_option( 'wp_collaboration_enabled' ) ) { 661 661 register_post_type( 662 662 'wp_sync_storage', … … 8673 8673 ); 8674 8674 8675 if ( get_option( 'wp_enable_real_time_collaboration' ) ) {8675 if ( (bool) get_option( 'wp_collaboration_enabled' ) ) { 8676 8676 register_meta( 8677 8677 'post', -
trunk/src/wp-includes/rest-api.php
r61833 r62058 431 431 432 432 // Collaboration. 433 if ( get_option( 'wp_enable_real_time_collaboration' ) ) {433 if ( (bool) get_option( 'wp_collaboration_enabled' ) ) { 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
r61946 r62058 255 255 * document, which can lead to duplicate inserts or deletions. 256 256 */ 257 $is_collaboration_enabled = get_option( 'wp_enable_real_time_collaboration' );257 $is_collaboration_enabled = (bool) get_option( 'wp_collaboration_enabled' ); 258 258 259 259 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && ! $is_collaboration_enabled ) { -
trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
r61833 r62058 571 571 572 572 public function test_rest_autosave_draft_post_same_author() { 573 add_filter( 'pre_option_wp_ enable_real_time_collaboration', '__return_zero' ); // Zero as false doesn't work for pre-flight options.573 add_filter( 'pre_option_wp_collaboration_enabled', '__return_zero' ); // Zero as false doesn't work for pre-flight options. 574 574 575 575 wp_set_current_user( self::$editor_id ); … … 747 747 748 748 public function test_update_item_draft_page_with_parent() { 749 add_filter( 'pre_option_wp_ enable_real_time_collaboration', '__return_zero' ); // Zero as false doesn't work for pre-flight options.749 add_filter( 'pre_option_wp_collaboration_enabled', '__return_zero' ); // Zero as false doesn't work for pre-flight options. 750 750 751 751 wp_set_current_user( self::$editor_id ); … … 931 931 */ 932 932 public function test_rest_autosave_draft_post_same_author_with_rtc() { 933 add_filter( 'pre_option_wp_ enable_real_time_collaboration', '__return_true' );933 add_filter( 'pre_option_wp_collaboration_enabled', '__return_true' ); 934 934 935 935 wp_set_current_user( self::$editor_id ); … … 977 977 */ 978 978 public function test_update_item_draft_page_with_parent_with_rtc() { 979 add_filter( 'pre_option_wp_ enable_real_time_collaboration', '__return_true' );979 add_filter( 'pre_option_wp_collaboration_enabled', '__return_true' ); 980 980 981 981 wp_set_current_user( self::$editor_id ); -
trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php
r61943 r62058 120 120 'default_comment_status', 121 121 'site_icon', // Registered in wp-includes/blocks/site-logo.php 122 'wp_ enable_real_time_collaboration',122 'wp_collaboration_enabled', 123 123 ); 124 124 -
trunk/tests/phpunit/tests/rest-api/rest-sync-server.php
r61865 r62058 18 18 self::$subscriber_id = $factory->user->create( array( 'role' => 'subscriber' ) ); 19 19 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 ); 20 23 } 21 24 … … 23 26 self::delete_user( self::$editor_id ); 24 27 self::delete_user( self::$subscriber_id ); 28 delete_option( 'wp_collaboration_enabled' ); 25 29 wp_delete_post( self::$post_id, true ); 26 30 } … … 30 34 31 35 // Enable option for tests. 32 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true');36 update_option( 'wp_collaboration_enabled', 1 ); 33 37 34 38 // Reset storage post ID cache to ensure clean state after transaction rollback. … … 109 113 global $wp_rest_server; 110 114 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 114 115 // Ensure the option is not in the database. 115 delete_option( 'wp_ enable_real_time_collaboration' );116 delete_option( 'wp_collaboration_enabled' ); 116 117 117 118 // Reset the REST server so routes are re-registered from scratch. … … 119 120 120 121 $routes = rest_get_server()->get_routes(); 121 $this->assertArray HasKey( '/wp-sync/v1/updates', $routes );122 $this->assertArrayNotHasKey( '/wp-sync/v1/updates', $routes ); 122 123 } 123 124 -
trunk/tests/qunit/fixtures/wp-api-generated.js
r61982 r62058 21 21 "wp-site-health/v1", 22 22 "wp-block-editor/v1", 23 "wp-abilities/v1", 24 "wp-sync/v1" 23 "wp-abilities/v1" 25 24 ], 26 25 "authentication": { … … 11161 11160 "required": false 11162 11161 }, 11163 "wp_ enable_real_time_collaboration": {11162 "wp_collaboration_enabled": { 11164 11163 "title": "", 11165 11164 "description": "Enable Real-Time Collaboration", … … 12774 12773 } 12775 12774 ] 12776 },12777 "/wp-sync/v1": {12778 "namespace": "wp-sync/v1",12779 "methods": [12780 "GET"12781 ],12782 "endpoints": [12783 {12784 "methods": [12785 "GET"12786 ],12787 "args": {12788 "namespace": {12789 "default": "wp-sync/v1",12790 "required": false12791 },12792 "context": {12793 "default": "view",12794 "required": false12795 }12796 }12797 }12798 ],12799 "_links": {12800 "self": [12801 {12802 "href": "http://example.org/index.php?rest_route=/wp-sync/v1"12803 }12804 ]12805 }12806 },12807 "/wp-sync/v1/updates": {12808 "namespace": "wp-sync/v1",12809 "methods": [12810 "POST"12811 ],12812 "endpoints": [12813 {12814 "methods": [12815 "POST"12816 ],12817 "args": {12818 "rooms": {12819 "items": {12820 "properties": {12821 "after": {12822 "minimum": 0,12823 "required": true,12824 "type": "integer"12825 },12826 "awareness": {12827 "required": true,12828 "type": [12829 "object",12830 "null"12831 ]12832 },12833 "client_id": {12834 "minimum": 1,12835 "required": true,12836 "type": "integer"12837 },12838 "room": {12839 "required": true,12840 "type": "string",12841 "pattern": "^[^/]+/[^/:]+(?::\\S+)?$"12842 },12843 "updates": {12844 "items": {12845 "properties": {12846 "data": {12847 "type": "string",12848 "required": true12849 },12850 "type": {12851 "type": "string",12852 "required": true,12853 "enum": [12854 "compaction",12855 "sync_step1",12856 "sync_step2",12857 "update"12858 ]12859 }12860 },12861 "required": true,12862 "type": "object"12863 },12864 "minItems": 0,12865 "required": true,12866 "type": "array"12867 }12868 },12869 "type": "object"12870 },12871 "type": "array",12872 "required": true12873 }12874 }12875 }12876 ],12877 "_links": {12878 "self": [12879 {12880 "href": "http://example.org/index.php?rest_route=/wp-sync/v1/updates"12881 }12882 ]12883 }12884 12775 } 12885 12776 }, … … 14777 14668 "default_category": 1, 14778 14669 "default_post_format": "0", 14779 "wp_ enable_real_time_collaboration": true,14670 "wp_collaboration_enabled": false, 14780 14671 "posts_per_page": 10, 14781 14672 "show_on_front": "posts",
Note: See TracChangeset
for help on using the changeset viewer.