Changeset 62075
- Timestamp:
- 03/20/2026 03:25:02 PM (2 months ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
-
wp-admin/options-writing.php (modified) (1 diff)
-
wp-includes/collaboration.php (modified) (2 diffs)
-
wp-includes/default-constants.php (modified) (1 diff)
-
wp-includes/post.php (modified) (2 diffs)
-
wp-includes/rest-api.php (modified) (1 diff)
-
wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-writing.php
r62058 r62075 113 113 <th scope="row"><?php _e( 'Collaboration' ); ?></th> 114 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> 115 <?php if ( ! defined( 'WP_ALLOW_COLLABORATION' ) || true === WP_ALLOW_COLLABORATION ) : ?> 116 <div class="notice notice-warning inline"> 117 <p><?php _e( '<strong>Note:</strong> Real-time collaboration has been disabled.' ); ?></p> 118 </div> 119 <?php else : ?> 120 <label for="wp_collaboration_enabled"> 121 <input name="wp_collaboration_enabled" type="checkbox" id="wp_collaboration_enabled" value="1" <?php checked( '1', (bool) get_option( 'wp_collaboration_enabled' ) ); ?> /> 122 <?php _e( 'Enable real-time collaboration' ); ?> 123 </label> 124 <?php endif; ?> 119 125 </td> 120 126 </tr> -
trunk/src/wp-includes/collaboration.php
r62058 r62075 6 6 * @since 7.0.0 7 7 */ 8 9 /** 10 * Determines whether real-time collaboration is enabled. 11 * 12 * If the WP_ALLOW_COLLABORATION constant is false, 13 * collaboration is always disabled regardless of the database option. 14 * Otherwise, falls back to the 'wp_collaboration_enabled' option. 15 * 16 * @since 7.0.0 17 * 18 * @return bool Whether real-time collaboration is enabled. 19 */ 20 function wp_is_collaboration_enabled() { 21 if ( ! defined( 'WP_ALLOW_COLLABORATION' ) || ! WP_ALLOW_COLLABORATION ) { 22 return false; 23 } 24 25 return (bool) get_option( 'wp_collaboration_enabled' ); 26 } 8 27 9 28 /** … … 19 38 global $pagenow; 20 39 21 if ( ! (bool) get_option( 'wp_collaboration_enabled') ) {40 if ( ! wp_is_collaboration_enabled() ) { 22 41 return; 23 42 } -
trunk/src/wp-includes/default-constants.php
r59146 r62075 399 399 define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS ); 400 400 } 401 402 /** 403 * Whether real time collaboration is permitted to be enabled. 404 * 405 * @since 7.0.0 406 */ 407 if ( ! defined( 'WP_ALLOW_COLLABORATION' ) ) { 408 $env_value = getenv( 'WP_ALLOW_COLLABORATION' ); 409 if ( false === $env_value ) { 410 // Environment variable is not defined, default to allowing collaboration. 411 define( 'WP_ALLOW_COLLABORATION', true ); 412 } else { 413 /* 414 * Environment variable is defined, let's confirm it is actually set to 415 * "true" as it may still have a string value "false" – the preceeding 416 * `if` branch only tests for the boolean `false`. 417 */ 418 define( 'WP_ALLOW_COLLABORATION', 'true' === $env_value ); 419 } 420 } 401 421 } 402 422 -
trunk/src/wp-includes/post.php
r62058 r62075 658 658 ); 659 659 660 if ( (bool) get_option( 'wp_collaboration_enabled') ) {660 if ( wp_is_collaboration_enabled() ) { 661 661 register_post_type( 662 662 'wp_sync_storage', … … 8673 8673 ); 8674 8674 8675 if ( (bool) get_option( 'wp_collaboration_enabled') ) {8675 if ( wp_is_collaboration_enabled() ) { 8676 8676 register_meta( 8677 8677 'post', -
trunk/src/wp-includes/rest-api.php
r62058 r62075 431 431 432 432 // Collaboration. 433 if ( (bool) get_option( 'wp_collaboration_enabled') ) {433 if ( wp_is_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
r62058 r62075 255 255 * document, which can lead to duplicate inserts or deletions. 256 256 */ 257 $is_collaboration_enabled = (bool) get_option( 'wp_collaboration_enabled');257 $is_collaboration_enabled = wp_is_collaboration_enabled(); 258 258 259 259 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && ! $is_collaboration_enabled ) {
Note: See TracChangeset
for help on using the changeset viewer.