BuddyPress Contributors Begin Work on Block-based Activity Post Form

BuddyPress broke into the world of blocks last month with its 6.0 release. Group and Member blocks were the first blocks to make it into the core plugin and next up are block versions of the existing widgets. Contributors are also working on block requests based on community feedback.

Today, BuddyPress core developer Mathieu Viet shared a prototype of his early work on adding a block based Activity post form to BuddyPress. This is one of the most highly-requested features from the plugin’s community of developers, according to a recent poll.

Viet submitted a PR for a playground inside the WP Admin that allows posting to the activity stream via a custom bp/text block. It is an adaptation of the basic core/paragraph block with a modified block toolbar that removes unnecessary controls, such as alignments, text color, and strikethrough formatting. 

The custom activity posting block adds a new emoji picker control to the block toolbar, with a popover that includes categories of all the emoji WordPress supports. This is far more convenient for users than launching their operating system’s emoji picker.

Viet’s PR highlighted several major benefits to bringing the block editor to activity posting: formatting text and adding links is more intuitive, inserting emoji is easier, and users can easily schedule activities using the block editor’s DateTimePicker component.

One of the biggest benefits Viet identified is the opportunity to standardize the UI. In the same way the block editor is helping WordPress unify the UI for publishing and site design, a block-based activity form will help standardize the UI for BuddyPress plugin developers.

“Today, when BuddyPress Plugin developers extend this post form, they do not have a structured way to process, they simply use a hook: it can be a very different one from plugin to plugin,” Viet said. “Plugins are mostly using jQuery (some can tidy this a bit using Backbone), UI controls can look very different. This is really not ideal for BuddyPress users. By extending the WordPress Blocks API to make available a BP Activity Blocks API we will improve all this and we’ll benefit from the ‘WordPress Blocks’ developers interest to give our users great new BP Activity Blocks to share richer content like media, or more interactive content like Polls.”

BuddyPress’ activity component is a frontend feature, so the idea is to test the block-based activity posting form in the admin and then work through the hurdles for bringing it to the frontend.

“Bringing this block based Activity post form in this area is the goal and a huge challenge mainly due to the fact we have less control over the layout,” Viet said. “There’s one WordPress administration layout, but there are thousands of different front-end layouts.”

Viet proposed BuddyPress tackle this in small steps:

  • Making the block based Activity Post form only available from a WP admin screen
  • Making the block based Activity Post form only available into a new complete “BP Default” theme
  • Making the block based Activity Post form available from a modal
  • Making the block based Activity Post form available from a new template pack

BuddyPress only supports WordPress 4.8+. If a block-based activity form is ready for inclusion in version 7.0 of the plugin, BuddyPress will need to raise the required WordPress version to 4.9. Sites running on older versions would be able to fall back to the legacy activity posting form.

Viet credits his PR to WordPress’ developer documentation for building a custom block editor and Dave Smith’s  Standalone Gutenberg Block Editor repository.


5 responses to “BuddyPress Contributors Begin Work on Block-based Activity Post Form”

  1. It is great to see BuddyPress embracing blocks.

    Congratulations and props to Viet and the team for the work on the new Activity section.

    Glad to see my tutorial and docs helped in a small way.

  2. This is cool but how can this be the top priority?

    Surely a media component that allows rich activity posts (ie upload an image etc) is the most glaring hole to be filled.

    The current plugin solutions are bloated messes.

    • Hi Peter, thanks for your opinion about it.

      You’re absolutely right, one of the top priority for BuddyPress is to include a Media component. It’s scheduled for our next major release (7.0.0). But while working on it, I realized being able to use blocks into the Activity post form would greatly help this component to let users easily choose a media from their Media library or upload a new one while writing their activity.

      And I believe using blocks will help BuddyPress plugin developers to get more control about how to interact with activity publishing.

      • Dear Mr Viet, Thank you to you and your team for the amazing plugin, really looking forward to front end media loading. Will be great if front end users can upload videos that go directly to the website’s videopress account. That would be a game changer as wordpress.com and jetpack accounts offer some amazing amount of space for videos that are uploaded to videopress. One of the basic jetpack accounts have 1TB and wordpress.com hosting has 200GB. It is more than enough space for a community site especially once the videos have been processed.

  3. Okay makes perfect sense. That will really be the missing piece of the puzzle. And thanks to you and the team for the great work btw. I love buddypress, and I use your wp-status class in a few of my plugins


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: