Skip to content

Commit 3263102

Browse files
committed
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: WordPress/wordpress-develop#11181. Props alecgeatches, mukesh27. See #64622. Built from https://develop.svn.wordpress.org/trunk@61986 git-svn-id: http://core.svn.wordpress.org/trunk@61268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 3c778c6 commit 3263102

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

wp-includes/collaboration.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,25 @@
1212
* @since 7.0.0
1313
*
1414
* @access private
15+
*
16+
* @global string $pagenow The filename of the current screen.
1517
*/
1618
function 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
}

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-beta4-61985';
19+
$wp_version = '7.0-beta4-61986';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)