Opened 22 months ago
Closed 22 months ago
#8765 closed task (fixed)
Early Introduce Activity Block filters and functions
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 11.0.0 | Priority: | high |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | has-patch has-unit-tests |
Cc: |
Description
I've been working on the BP Attachments && BP Activity Block Editor add-ons. These two plugins are using BuddyPress blocks to generate their content. When working on supporting the old BP Activity Post Form, I've decided to use a block to attach a media to an activity. Doing so, it allows us to use the same render function for any Editor using blocks (Post, Site and soon Activities).
To avoid duplicating functions into these two plugins, I think it's a smarter idea to already include them into BuddyPress without loading them by default. This way, these two plugins will only have to use add_filter( 'bp_is_activity_blocks_active', '__return_true' );
to enjoy them.
The other part of the patch is about the bp_core_check_for_moderation()
function we use to prevent spams. As BP Attachments is adding blocks to the activity content, the $max_links
allowed can be reached very quickly as these blocks attributes contain URL to the shared media. I suggest to allow URLs starting with the community website URL as I doubt spammers would use it!
I'll link a PR to this ticket asap.
These functions will be very useful for the BP Attachments and BP Activity Block Editor add-ons.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8765