[buddypress-trac] [BuddyPress Trac] #5669: Help plugins to generate activities for their post type(s)

buddypress-trac noreply at wordpress.org
Sun Nov 23 18:08:56 UTC 2014

#5669: Help plugins to generate activities for their post type(s)
 Reporter:  imath                  |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  2.2
Component:  Activity               |     Version:  2.0
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |
Changes (by imath):

 * keywords:  2nd-opinion has-patch needs-unit-tests => 2nd-opinion has-


 In 5669.03.patch i've edited the way the tracking data was collected as
 suggested boonebgorges. To avoid "race conditions" i've created a new
 action {{{bp_fully_loaded}}} which hooks to {{{wp_loaded}}}. Unfortunately
 i cannot rely on {{{bp_ready}}} as it's too late for the activity
 administration screen (dropdown list of activity actions).

 {{{wp_loaded}}} exists since WP 3.0 and is fired once WordPress, plugins
 and themes are fully loaded.

 I'm now using {{{add_post_type_support( 'post', 'buddypress-activity' )}}}
 also for the Blogs component. It means i've deprecated some functions and
 the Site Tracking feature for '''posts''' mainly rely on the new activity
 functions. I took many precautions to keep on using filters and actions
 that was used in the deprecated functions so that it should not have an
 impact on people using them. I haven't change anything about comments
 tracking. I think it could happen in a future step.

 As i'm no more hooking {{{bp_init}}} before
 {{{bp_register_activity_actions}}}, i've also needed to introduce a new
 parameter to {{{bp_activity_set_action()}}}: 'position'. By default it's
 set to {{{0}}}. It helps me to be sure the "Posts" activity action will be
 listed before the "Comments" one. To do so, i've introduced a new function
 that sort the actions for a given component

 Finally i've added some unit tests and found a bug in the way the Blogs
 component is dealing with password protected posts. If you publish a post
 as public, an activity is generated. If you update this post by setting a
 password the activity is updated. I think it should be deleted.

 Ran all the tests in regular and multisite mode and everything is ok.
 "Generating" post types activities is really expected by users, it would
 really be great if we could do this first step for the 2.2 milestone.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5669#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list