[buddypress-trac] [BuddyPress] #4033: adding action in bp_activity_get_specific

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Feb 23 22:23:28 UTC 2012


#4033: adding action in bp_activity_get_specific
-------------------------------+------------------------------
 Reporter:  sboisvert          |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Activity           |     Version:
 Severity:  trivial            |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback


Comment:

 It's hard to imagine other real use cases for an action like this.

 Can I suggest that you just hook your unhook function to the same hook,
 with a lower priority?

 {{{
 function bbg_remove_filters( $sql ) {
    remove_filter( 'bp_activity_get_user_join_filter', 'filter_to_remove'
 );
    return $sql;
 }
 add_filter( 'bp_activity_get_user_join_filter', 'bbg_remove_filters' );
 }}}

 This is not terribly elegant, but at least it doesn't require adding an
 otherwise not-very-useful action hook.

 As for detecting whether it's a single request: you could check {{{strpos(
 $sql, 'a.id IN' )}}}. (In the future, I would like to pass all of the
 function arguments to the hook, but I kinda don't want to do that until
 they've been converted to an array. See #3797)

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4033#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list