Make WordPress Core

Changeset 61986


Ignore:
Timestamp:
03/12/2026 01:12:18 PM (5 weeks ago)
Author:
ellatrix
Message:

Real-time collaboration: disable for site editor.

In performance tests, editing large documents in the site-editor suite (loading large-post.html) can cause performance tests in the site editor to time out with memory errors.

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

Props alecgeatches, mukesh27.
See #64622.

File:
1 edited

Legend:

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

    r61833 r61986  
    1313 *
    1414 * @access private
     15 *
     16 * @global string $pagenow The filename of the current screen.
    1517 */
    1618function wp_collaboration_inject_setting() {
    17     if ( get_option( 'wp_enable_real_time_collaboration' ) ) {
    18         wp_add_inline_script(
    19             'wp-core-data',
    20             'window._wpCollaborationEnabled = true;',
    21             'after'
    22         );
     19    global $pagenow;
     20
     21    if ( ! get_option( 'wp_enable_real_time_collaboration' ) ) {
     22        return;
    2323    }
     24
     25    // Disable real-time collaboration on the site editor.
     26    $enabled = true;
     27    if ( 'site-editor.php' === $pagenow ) {
     28        $enabled = false;
     29    }
     30
     31    wp_add_inline_script(
     32        'wp-core-data',
     33        'window._wpCollaborationEnabled = ' . wp_json_encode( $enabled ) . ';',
     34        'after'
     35    );
    2436}
Note: See TracChangeset for help on using the changeset viewer.