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:

add_post_type_support( 'book', 'buddypress-activity' );

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.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let's discuss your ideas.

5 Comments


  1. Finally its here! been waiting for this looooong time!
    Time to get rid of custom solutions!

    Report


  2. Good on them for the the post type support, but that function add_post_type_support() is the exact same function name that Jetpack uses for their post type support. That could cause some conflicts.

    Report


  3. 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.

    Report


  4. Great news. Have rolled out a custom solution for this myself, would have much preferred such a simple solution.

    Also great use of expanding on core custom post type support. There’s a whole bunch of things that can be used for.

    Report

Comments are closed.