SIGN IN SIGN UP

Real-Time Collaboration: Define WP_ALLOW_COLLABORATION in wp_is_collaboration_allowed()

#62075 introduced the WP_ALLOW_COLLABORATION constant to help hosts disable RTC at the platform level. The constant was defined in wp_functionality_constants(), which runs in wp-settings.php after collaboration.php is loaded. That created a boot-order edge case where wp_is_collaboration_enabled() could be called before the constant existed – for instance via SHORTINIT.

This commit moves the constant definition into a new wp_is_collaboration_allowed() function in collaboration.php. The function checks the constant, and if it's missing, defines it on the spot from the environment variable (defaulting to true). wp_is_collaboration_enabled() now delegates to wp_is_collaboration_allowed() for the constant check, and the admin UI calls wp_is_collaboration_allowed() directly to decide whether to show the checkbox or a "disabled" notice. It also slightly improves the label of the "enable RTC" checkbox on the settings page.


Props peterwilsoncc, mcsf, joen, ingeniumed.

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

See #64904.



git-svn-id: https://develop.svn.wordpress.org/trunk@62100 602fd350-edb4-49c9-b593-d223f7449a82
A
Adam Zieliński committed
a698ea65b2c479a2cf043e3f4d6d10bdc8040b91
Parent: e77b83c