[Bb-trac] Re: [bbPress] #727: BB_Query has no method to append WHERE - proposal for fix

bbPress bb-trac at lists.bbpress.org
Sat Aug 11 22:30:39 GMT 2007


#727: BB_Query has no method to append WHERE - proposal for fix
----------------------+-----------------------------------------------------
 Reporter:  _ck_      |        Owner:                   
     Type:  defect    |       Status:  new              
 Priority:  high      |    Milestone:                   
Component:  Back-end  |      Version:  1.0-alpha (trunk)
 Severity:  normal    |   Resolution:                   
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by mdawaffe):

 Replying to [comment:2 _ck_]:
 > But BB_Query is used for everything now though, not just latest topics -
 are you saying if a "get_latest_topics_where" filter exists, will be used
 for any query passed through BB_Query?

 No, the {{{get_latest_topics_where}}} hook is only called when the
 BB_Query class is used within the {{{get_latest_topics()}}} function.

 source:/trunk/bb-includes/functions.php at 920#L148

 The third parameter specifies the "id" of the query that the BB_Query
 class is about to construct.

 source:/trunk/bb-includes/classes.php at 920#L618

 The {{{"{$id}_where" == "get_latest_topics_where"}}} hook (and _join, and
 _order_by, ...) is called.

 Any other function that uses the BB_Query class will not fire the
 "get_latest_topics_where" hook, but will fire hooks named after the
 respective id those functions pass to BB_Query.

 As an example already in core, see {{{get_recent_user_replies()}}},
 {{{get_recent_user_replies_fields()}}}, and
 {{{get_recent_user_replies_group_by()}}} in bb-includes/functions.php and
 how they are connected in bb-includes/default-filters.php.

-- 
Ticket URL: <http://trac.bbpress.org/ticket/727#comment:3>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list