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

buddypress-trac noreply at wordpress.org
Mon Nov 24 23:35:29 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  |
-----------------------------------+------------------

Comment (by imath):

 Thanks a lot for your advises :) You're right i'm overthinking the
 translation thing.

 In 5669.04.pacth

 - I think each tests are now resetting the tracking global.
 - I've edited
 {{{test_bp_activity_catch_transition_post_type_status_publish_to_publish()}}}
 the way you suggested
 - i've added an action at the end of
 {{{bp_activity_tracking_register_post_types()}}}

 It's now possible to define custom action strings when registering the
 post type, for instance :
 {{{
 $labels = array(
         'name'                    => 'bars',
         'singular_name'           => 'bar',
         'bp_activity_new_post'    => __( '%1$s shared a new <a
 href="%2$s">bar</a>', 'bar-domain' ),
         'bp_activity_new_post_ms' => __( '%1$s shared a new <a
 href="%2$s">bar</a>, on the site %3$s', 'bar_domain' ),
 );

 register_post_type( 'bars', array(
         'labels'   => $labels,
         'public'   => true,
         'supports' => array( 'buddypress-activity' ),
 ) );
 }}}

 It's also possible to change any tracking params of the tracked post type
 (as soon as it's after 'bp_fully_loaded' )

 {{{
 function page_supports_tracking() {
         add_post_type_support( 'page', 'buddy press-activity' );
 }
 add_action( 'bp_init', 'page_supports_tracking' );

 function page_tracking_args() {
         bp_activity_set_post_type_tracking_args( 'page', array(
                 'component_id' => buddypress()->blogs->id,
         ) );
 }
 add_action( 'bp_ready', 'page_tracking_args' );
 }}}

 Finally, I've added tests for the custom strings and the
 {{{bp_activity_set_post_type_tracking_args()}}} function.

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


More information about the buddypress-trac mailing list