[buddypress-trac] [BuddyPress Trac] #7503: Add identifying tag parameter to bp_has_*() loop arguments.

buddypress-trac noreply at wordpress.org
Mon Apr 17 20:10:13 UTC 2017


#7503: Add identifying tag parameter to bp_has_*() loop arguments.
--------------------------+-----------------------------
 Reporter:  dcavins       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 When filtering arguments via hooks like `bp_after_has_groups_parse_args`,
 knowing more about the loop's context would help determine whether filters
 should be applied and how. At the moment, you can look at the incoming
 arguments and make a guess, but it would be easier to target the loop in
 the group widget, for instance, and not the main groups directory loop on
 the same page, if the widget's parameters included `'context' => 'widget'`
 or similar.

 These loops are good candidates for this additional parameter:
 • `bp_has_activities()`
 • `bp_has_blogs()`
 • `bp_has_groups()`
 • `bp_has_members()`
 • `bp_has_message_threads()`
 • `bp_has_notifications()`
 • `bp_has_profile()`

 The function `bp_has_activities()` is used in a number of ways within BP:
 • `bp_activity_embed_has_activity()` to embed activity items
 • `bp_activity_heartbeat_last_recorded()` to return new activity items
 • RSS feed output
 • Recent posts widget
 • `activity-loop.php` (template used in a number of contexts)
 • Activity single item display

 @jjj notes that bbPress does something similar in `bbp_set_query_name()`:
 https://bbpress.trac.wordpress.org/browser/tags/2.5.12/includes/common/template.php#L2011

 This is not a technically difficult change to make, but we should decide
 what we want to call the parameter and what pattern should be used for the
 names. We could use names patterned like OOCSS, for example:
 `'loop_name' => 'directory--main'`

 Thanks for your thoughts about how to make this small change as useful as
 possible.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7503>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list