HEX
Server: Apache
System: Linux c240a.dattaweb.com 4.18.0-553.123.2.el8_10.x86_64 #1 SMP Thu May 7 15:28:41 EDT 2026 x86_64
User: c2401259 (162186)
PHP: 8.3.31
Disabled: system, shell, exec, system_exec, shell_exec, mysql_pconnect, passthru, popen, proc_open, proc_close, proc_nice, proc_terminate, proc_get_status, escapeshellarg, escapeshellcmd, eval, dl, imap_mail, libvirt_connect, gnupg_init, unsetenv, apache_setenv, pcntl_exec, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_get_handler, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_getpriority, pcntl_setpriority, pcntl_async_signals, opcache_get_status, opcache_reset, opcache_get_configuration
Upload Files
File: /home/c2401259/public_html/wp-includes/collaboration.php
<?php
/**
 * Bootstraps collaborative editing.
 *
 * @package WordPress
 * @since 7.0.0
 */

/**
 * Determines whether real-time collaboration is enabled.
 *
 * If the WP_ALLOW_COLLABORATION constant is false,
 * collaboration is always disabled regardless of the database option.
 * Otherwise, falls back to the 'wp_collaboration_enabled' option.
 *
 * @since 7.0.0
 *
 * @return bool Whether real-time collaboration is enabled.
 */
function wp_is_collaboration_enabled() {
	return (
		wp_is_collaboration_allowed() &&
		(bool) get_option( 'wp_collaboration_enabled' )
	);
}

/**
 * Determines whether real-time collaboration is allowed.
 *
 * If the WP_ALLOW_COLLABORATION constant is false,
 * collaboration is not allowed and cannot be enabled.
 * The constant defaults to true, unless the WP_ALLOW_COLLABORATION
 * environment variable is set to string "false".
 *
 * @since 7.0.0
 *
 * @return bool Whether real-time collaboration is enabled.
 */
function wp_is_collaboration_allowed() {
	if ( ! defined( 'WP_ALLOW_COLLABORATION' ) ) {
		$env_value = getenv( 'WP_ALLOW_COLLABORATION' );
		if ( false === $env_value ) {
			// Environment variable is not defined, default to allowing collaboration.
			define( 'WP_ALLOW_COLLABORATION', true );
		} else {
			/*
			 * Environment variable is defined, let's confirm it is actually set to
			 * "true" as it may still have a string value "false" – the preceeding
			 * `if` branch only tests for the boolean `false`.
			 */
			define( 'WP_ALLOW_COLLABORATION', 'true' === $env_value );
		}
	}

	return WP_ALLOW_COLLABORATION;
}

/**
 * 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 ( ! wp_is_collaboration_enabled() ) {
		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'
	);
}