CoreFiles by mySites.guru
collaboration.php36 lines, 689 bytes, from wordpress-7.0-beta5.zip
Raw History Compare with 7.0-beta4
md5
24bb10cbb03b06eb0da939d18b4537d8
sha1
567440b42719c6f4c45c1f02b5eaa409141102e8
sha256
a43aa82bcdbf60ab342f2dac09b6943e707bab64e8a2d226e2b72179bb1bf04e
<?php
/**
 * Bootstraps collaborative editing.
 *
 * @package WordPress
 * @since 7.0.0
 */

/**
 * Injects the real-time collaboration setting into a global variable.
 *
 * @since 7.0.0
 *
 * @access private
 *
 * @global string $pagenow The filename of the current screen.
 */
function wp_collaboration_inject_setting() {
	global $pagenow;

	if ( ! get_option( 'wp_enable_real_time_collaboration' ) ) {
		return;
	}

	// Disable real-time collaboration on the site editor.
	$enabled = true;
	if ( 'site-editor.php' === $pagenow ) {
		$enabled = false;
	}

	wp_add_inline_script(
		'wp-core-data',
		'window._wpCollaborationEnabled = ' . wp_json_encode( $enabled ) . ';',
		'after'
	);
}

No other release has this exact content. See every version of this file.