[buddypress-trac] [BuddyPress Trac] #6482: Comment syncing between activity and post comments for Custom Post Types
buddypress-trac
noreply at wordpress.org
Wed Jun 10 17:51:06 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.4
Component: Component - Blogs | Version: 2.2
Severity: normal | Resolution:
Keywords: has-patch needs-testing needs-unit- |
tests dev-feedback |
-------------------------------------------------+-------------------------
Changes (by imath):
* keywords: => has-patch needs-testing needs-unit-tests dev-feedback
Comment:
6482.01.patch is a first pass to "abstract" comments tracking / post
comments - activity comments syncing for any post type.
How to use it the shortest way, example for the page post type :
{{{
add_post_type_support( 'page', 'buddypress-activity' );
bp_activity_set_post_type_tracking_args( 'page', array(
'comment_action_id' => 'new_blog_page_comment',
) );
}}}
You just need to specify the action id of the comment action. Of course
you can add labels to customize the drop down filters or the activity
action string. To test it, i've used
[https://gist.github.com/imath/4f776e488b0d5efa1294 this gist], so be my
guest to use it for your tests!
Some thoughts:
- as the option to allow/disallow syncing is not "attached" to the Blogs
component, in a future release i guess we could move a lot of the code
that is today in `bp-blogs-activity.php` in a bp-activity file. For now,
to avoid deprecating too much function, i think we should keep it this
way.
- Filtering activity stream for new_{post_type}_comment actions when
comment syncing is on: i had to use a new activity meta containing the
parent action (e.g.: bp_parent_action -> new_{post_type} ) to be able to
fetch the right activity_comments into the new_{post_type}_comment. This
work made me find an issue with the current feature see #6485. This also
means we'll need an upgrade routine for the existing activity comments
that are linked to post comments.
- Deleting a comment from front end when comment syncing is on. The
current feature will systematically display an error although the activity
comments / post comments are successfully deleted. To avoid this, i've
used an `apply_filters_ref_array()`. About deleting, we also have this
issue with the current feature #6484
I'd feel more comfortable :
- with lots (and even more than a lot!) of testing by contributors who are
interested or requested this feature
- with more unit tests about it.
- having #6143 fixed because i was able to see who this is impacting
scopes
- And above all, having r-a-y's eyes on the patch.
If we have this in, we complete the second step of #3460. Last step is the
UI which could be fixed once we have #6026 in.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6482#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list