[buddypress-trac] [BuddyPress Trac] #6482: Comment syncing between activity and post comments for Custom Post Types

buddypress-trac noreply at wordpress.org
Tue Dec 29 18:40:24 UTC 2015


#6482: Comment syncing between activity and post comments for Custom Post Types
--------------------------------------------------+-----------------------
 Reporter:  shanebp                               |       Owner:  imath
     Type:  enhancement                           |      Status:  assigned
 Priority:  normal                                |   Milestone:  2.5
Component:  Component - Blogs                     |     Version:  2.2
 Severity:  normal                                |  Resolution:
 Keywords:  needs-testing dev-feedback has-patch  |
--------------------------------------------------+-----------------------

Comment (by imath):

 Thanks for your feedback @shanebp

 to test the patch on front end, you'll need to add this line inside `wp-
 config.php`

 `define( 'SCRIPT_DEBUG', true );`

 About `register_post_type()` It's already built in the patch actually.
 There's a unit test showing how to do :
 `test_bp_activity_format_activity_action_custom_post_type_comment`

 For the post type tracking arguments, it hasn't changed from what we have
 in the codex page about Post type activities. To set the comment tracking
 feature, you can do something like this :

 {{{
 $labels = array(
         'name'                              => 'foos',
         'singular_name'                     => 'foo',
         'bp_activity_comments_admin_filter' => __( 'Comments about foos',
 'buddypress' ), // label for the Admin dropdown filter
         'bp_activity_comments_front_filter' => __( 'Foo Comments',
 'buddypress' ), // label for the Front dropdown filter
         'bp_activity_new_comment'           => __( '%1$s commented on the
 <a href="%2$s">foo</a>', 'buddypress' ),
         'bp_activity_new_comment_ms'        => __( '%1$s commented on the
 <a href="%2$s">foo</a>, on the site %3$s', 'buddypress' )
 );

 register_post_type( 'foo', array(
         'labels'   => $labels,
         'public'   => true,
         'supports' => array( 'buddypress-activity', 'comments' ), //
 Adding the comments support
         'bp_activity' => array(
                 'action_id'         => 'new_foo', // The activity type for
 posts
                 'comment_action_id' => 'new_foo_comment', // The activity
 type for comments
         ),
 ) );
 }}}

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


More information about the buddypress-trac mailing list