-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add WP_ALLOW_COLLABORATION constant #11311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
alecgeatches
wants to merge
8
commits into
WordPress:trunk
from
alecgeatches:add/disable-collaboration-flag
+54
−9
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3041494
Add WP_DISABLE_COLLABORATION constant and wrapper wp_is_collaboration…
alecgeatches 6727bfb
Merge branch 'trunk' into add/disable-collaboration-flag
alecgeatches 7d114c8
Use `wp_collaboration_enabled` instead of old flag `enable_real_time_…
alecgeatches c77ced1
Switch the constant to be a positive intent based on feedback
ingeniumed 9bd0e60
Merge branch 'trunk' into add/disable-collaboration-flag
alecgeatches 72f9195
Check if the constant is defined() before using it
adamziel be03ad0
Update src/wp-admin/options-writing.php
adamziel c76e32b
Clarify the string "false" vs boolean "false" in collaboration.php
adamziel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential edge case to verify here: if
wp_is_collaboration_enabled()is called beforeWP_ALLOW_COLLABORATIONis defined, RTC will also be disabled regardless of the database option.Can we verify that this function can't be called before the constant is defined? If we can't verify this, or we found a way to call
wp_is_collaboration_enabled()before the constant was declared, can we amend the docs to make this edge case clear?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant is defined in
wp_functionality_constants();which is called inwp-settings.php(afterrequire "collaboration.php") so the premature reference would have to happen at some point in the WordPress boot flow before that call (or via SHORTINIT). Two possible solutions I see are:AUTOSAVE_INTERVAL,EMPTY_TRASH_DAYS,WP_POST_REVISIONS, andWP_CRON_LOCK_TIMEOUT.collaboration.php, maybe even inside of that function if it's not defined by the time of the call. That would look something like this:Which would be fine with me. There's a precedence of a similar behavior in kses.php:
https://github.com/alecgeatches/wordpress-develop/blob/be03ad089eae148e2d95e429579022bef69c77c9/src/wp-includes/kses.php#L32-L53
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we keep this part as it is for beta6 and revisit it in RC1 cc @ellatrix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that this makes sense to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, I hadn't noticed the order of operations.
Of the two suggestions I think defining the constant in
wp_is_collaboration_enabled()is the safest approach for RC1. @adamziel are you able to look in to this in #11322 (I'm at a mate's 50th today so won't have a chance, sorry).