BuddyPress 2.2 to Add Custom Post Type Support to the Activity Stream

buddypress-wall

BuddyPress 2.2 is shaping up to be an exciting release, packed full of new features for developers. Support for Composer will be included in 2.2, as well as a basic member type API, which will allow developers to create different user types.

The upcoming 2.2 release will also introduce the ability for new activity items to be generated when content is created by registered post types. This is a feature that already exists within the BuddyPress’ blogs component and will be extended to include custom post types that declare support for it. Developers will be able to add support for CPTs with one simple line of code:

[php light=”true”]add_post_type_support( ‘book’, ‘buddypress-activity’ );[/php]

This will publish updates to the activity stream for the post type that you specify, using generic strings. The BuddyPress codex has already been updated to show examples for how you can get more control over the activity attributes when you register the post type.

cpt-activity

“This update is about the first step of it: ease the implementation of tracking the published post type items into the Activity stream,” BuddyPress core developer Mathieu Viet explained in the announcement on the BP development blog.

When post type support is added to the activity stream, you will also be able to sort the new items via the activity dropdown filters. This filter is available on the frontend and in the backend.

activity-dropdown

These improvements are all recent additions to BuddyPress trunk. If you want to test 2.2 alpha, checkout BuddyPress trunk via SVN or download the zip file. Activate it and then add support for a custom post type that is active on your BuddyPress test site.

The ticket that houses the discussion on this issue has been open for three years. BuddyPress 2.2 finally answers this request and gives plugin developers a beautifully simple implementation for adding post type support to the activity stream.

5

5 responses to “BuddyPress 2.2 to Add Custom Post Type Support to the Activity Stream”

  1. Yes! This is it – I’ve been following that ticket for much of its life (and even tried to contribute to the conversation a few times. This really is one of those headline features for a release and particularly excited about it. This advancement, even though it is in its early stages is one of those things that will push BuddyPress forward by a significant leap. Real tracking of all a site’s activity. Just awesome.

Newsletter

Subscribe Via Email

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