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/collaboration.php

    r62058 r62075  
    66 * @since 7.0.0
    77 */
     8
     9/**
     10 * Determines whether real-time collaboration is enabled.
     11 *
     12 * If the WP_ALLOW_COLLABORATION constant is false,
     13 * collaboration is always disabled regardless of the database option.
     14 * Otherwise, falls back to the 'wp_collaboration_enabled' option.
     15 *
     16 * @since 7.0.0
     17 *
     18 * @return bool Whether real-time collaboration is enabled.
     19 */
     20function wp_is_collaboration_enabled() {
     21    if ( ! defined( 'WP_ALLOW_COLLABORATION' ) || ! WP_ALLOW_COLLABORATION ) {
     22        return false;
     23    }
     24
     25    return (bool) get_option( 'wp_collaboration_enabled' );
     26}
    827
    928/**
     
    1938    global $pagenow;
    2039
    21     if ( ! (bool) get_option( 'wp_collaboration_enabled' ) ) {
     40    if ( ! wp_is_collaboration_enabled() ) {
    2241        return;
    2342    }
Note: See TracChangeset for help on using the changeset viewer.