Skip to:
Content

BuddyPress.org

#8765 closed task (fixed)

Early Introduce Activity Block filters and functions

Reported by: imath's profile imath Owned by: imath's profile imath
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.

Change History (2)

This ticket was mentioned in PR #38 on buddypress/buddypress by @imath.


22 months ago
#1

  • Keywords has-patch has-unit-tests added

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

#2 @imath
22 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13370:

Silently introduce block support for Activity content

Functions and filters bringing support for Block based activity content are disabled by default. We're adding these so that it's easier to progress on building a Block Based activity post form from a feature as a plugin and the BP Attachments BuddyPress Add-on. To allow Activity content to support blocks, we simply need to use this filter add_filter( 'bp_is_activity_blocks_active', '__return_true' ); .

This commit also allowes community users to share more than 2 links when these links are coming from the website BuddyPress is activated on.

Closes https://github.com/buddypress/buddypress/pull/38
Fixes #8765

Note: See TracTickets for help on using tickets.