Skip to content

Add backport for WP_ALLOW_COLLABORATION#76716

Merged
ingeniumed merged 8 commits intotrunkfrom
add/wordpress-collab-disable-backport
Mar 30, 2026
Merged

Add backport for WP_ALLOW_COLLABORATION#76716
ingeniumed merged 8 commits intotrunkfrom
add/wordpress-collab-disable-backport

Conversation

@ingeniumed
Copy link
Copy Markdown
Contributor

What?

Backport WP_ALLOW_COLLABORATION constant from WordPress/wordpress-develop#11311

Why?

This will allow collaboration to be disallowed at an environment level, or individually using a constant.

Backport PR for WordPress/wordpress-develop#11311

@ingeniumed ingeniumed added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration Backported to WP Core Pull request that has been successfully merged into WP Core labels Mar 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ingeniumed
Copy link
Copy Markdown
Contributor Author

Noting that this work was originally done by @alecgeatches so he's looped in as well 🙏🏾

@alecgeatches alecgeatches force-pushed the add/wordpress-collab-disable-backport branch from 1036387 to 76c8a00 Compare March 20, 2026 21:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

Flaky tests detected in edfbfe2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23510208424
📝 Reported issues:

@ingeniumed ingeniumed force-pushed the add/wordpress-collab-disable-backport branch from 76c8a00 to 304a34a Compare March 22, 2026 22:36
lib/load.php Outdated
}

// Gutenberg should have RTC enabled by default, unlike in core.
if ( ! defined( 'WP_ALLOW_COLLABORATION' ) ) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a better place to do this, let me know.

This will get overriden if someone defines this for their site or in their wp-config.php.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WordPress/wordpress-develop#11333 (review)

Looks like this will be what'll be ported then.

Noting that part of my comment was confirming how much of the constant is to be ported (given RTC is enabled here and not in core) so this clarifies it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to match the logic above by @adamziel

@ingeniumed
Copy link
Copy Markdown
Contributor Author

ingeniumed commented Mar 23, 2026

Core's Implementation

  • RTC is off by default, it can be turned on
  • WP_ALLOW_COLLABORATION can be set to false to prevent RTC from being turned on
    If it's not set to false, it'll be set to true by default so the RTC checkbox works as expected.

Gutenberg's Implementation with this PR

  • RTC is on by default (RTC: Use activation hook to enable RTC by default #76736 does this already but I've tweaked the option)
  • define the WP_ALLOW_COLLABORATION constant to true, if it's not already defined by core or by a site owner
  • keep the rest of the core code the same so we respect how WP_ALLOW_COLLABORATION works
CleanShot 2026-03-23 at 13 53 49

I had three Qs in my mind for Gutenberg's implementation that came to mind:

  1. Should support for WP_ALLOW_COLLABORATION still be there in this PR?
  2. Should setting WP_ALLOW_COLLABORATION to false prevent anyone from turning RTC on?
  3. Should WP_ALLOW_COLLABORATION be set to true if its not set, or should it always be true?

@ingeniumed ingeniumed force-pushed the add/wordpress-collab-disable-backport branch from 07aed26 to 28d57e3 Compare March 23, 2026 23:30
@ingeniumed ingeniumed requested a review from alecgeatches March 24, 2026 20:17
@ingeniumed ingeniumed enabled auto-merge (squash) March 25, 2026 00:42
@ingeniumed ingeniumed merged commit 4f4a7b1 into trunk Mar 30, 2026
43 of 48 checks passed
@ingeniumed ingeniumed deleted the add/wordpress-collab-disable-backport branch March 30, 2026 23:02
@github-actions github-actions bot added this to the Gutenberg 22.9 milestone Mar 30, 2026
adamsilverstein pushed a commit that referenced this pull request Mar 31, 2026
* Add the backport for the WP PR

* Add in the backprot link

* Port over the missing notices and ensure WP_ALLOW_COLLABORATION is set to true

* Fix the formatting

* Change the default to true

* Move the constant setting code to collaboration.php

* CR feedback

* fix the php formatting

Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
@mcsf mcsf added [Type] Enhancement A suggestion for improvement. and removed [Type] Task Issues or PRs that have been broken down into an individual action to take labels Apr 1, 2026
ObliviousHarmony pushed a commit that referenced this pull request Apr 1, 2026
* Add the backport for the WP PR

* Add in the backprot link

* Port over the missing notices and ensure WP_ALLOW_COLLABORATION is set to true

* Fix the formatting

* Change the default to true

* Move the constant setting code to collaboration.php

* CR feedback

* fix the php formatting

Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants