Prevent activity from private sites to be visible in sitewide stream #11
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.
BuddyPress will record blog post and comments into the activity stream if the Site Visibility setting is not zero:
https://github.com/buddypress/buddypress/blob/fea0e21ecc2847933bebc3b0aa126c519cda1082/src/bp-blogs/bp-blogs-filters.php#L107-L118
Because the More Privacy Options plugin adds visibility options that have negative values, this means that blog post and comment activity from private sites will end up being recorded and visible in the sitewide activity stream.
This PR opts to set the
'hide_sitewide'
activity flag to zero for blog posts and comments from private sites.However, it's worthwhile to note that if the Site Visibility option is set to
0
(Discourage search engines from indexing this site), BuddyPress will not even record the activity item. Instead of hiding the activity item as in this PR, should we be actively blocking the activity item from being recorded in the first place?Having a record in the activity stream might be beneficial, so I opted to just hide it.
But we can switch to blocking if we want to mirror what BuddyPress is doing.Looks like we decided internally to not do what BuddyPress is doing, so this PR should be fine.