Make WordPress Core


Ignore:
Timestamp:
03/20/2026 03:25:02 PM (3 months ago)
Author:
ellatrix
Message:

Real-time collaboration: Add WP_ALLOW_COLLABORATION constant.

This provides an easy way at config level to disable real-time collaboration.

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

See #64904.
Props alecgeatches, ingeniumed, zieladam, peterwilsoncc, tyxla.

File:
1 edited

Legend:

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

    r59146 r62075  
    399399        define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS );
    400400    }
     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    }
    401421}
    402422
Note: See TracChangeset for help on using the changeset viewer.