[buddypress-trac] [BuddyPress] #5130: Synchronizing activity comments to main component
buddypress-trac
noreply at wordpress.org
Mon Aug 5 07:48:41 UTC 2013
#5130: Synchronizing activity comments to main component
-------------------------+--------------------
Reporter: r-a-y | Owner: r-a-y
Type: enhancement | Status: new
Priority: normal | Milestone: 1.9
Component: Core | Version: 1.2
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------
Comment (by r-a-y):
01.patch addresses several points from the ticket description and is
considered a work-in-progress.
'''1) Main component callback registration'''
In the `BP_Component` class, I have added a new method that will check to
see if an extended component has added the
`activity_comment_post_callback` property. If it does, then
`BP_Component` will automatically set up some hooks that the extended
component will use.
An example of how this is used can be found in the `BP_Blogs_Component`
class.
I felt this was the best way for plugin devs to register their callbacks
in the current API. Let me know what you think.
'''2) ~~Two-way~~ One-way sync of activity comments''' :)
So far, I have completed 2-1 and a portion of 2-3.
To test, make sure in "Settings > BuddyPress > Settings", that "Allow
activity stream commenting on blog and forum posts" is checked.
For 2-1, once the patch is applied, in the activity directory, navigate to
an activity item with the `new_blog_post` type. Next, add an activity
comment. A corresponding blog comment should be posted on the blog post
permalink page. Nested levels should work as well!
For 2-3, this is a little tricky and is not quite complete yet. As noted
in the ticket description, in WP, when a parent comment is deleted, the
child comments are moved up a level, while BP simply deletes all activity
children.
----
In the patch, you'll also notice that I'm using a lot of this:
{{{
$cannot_comment = isset( buddypress()->site_options['bp-disable-blogforum-
comments'] ) ? buddypress()->site_options['bp-disable-blogforum-comments']
: false;
}}}
Instead of `bp_disable_blogforum_comments()` because
`bp_disable_blogforum_comments()` uses `bp_get_option()` and that will
kinda suck on multisite installs.
Anyway, I just wanted to get something up before the start of the week.
Hope you dig what I've got so far. Looking forward to some feedback.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5130#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list