[buddypress-trac] [BuddyPress Trac] #6052: bp_activity_show_filters() & BP Default / Standalone themes

buddypress-trac noreply at wordpress.org
Mon Dec 1 16:22:27 UTC 2014


#6052: bp_activity_show_filters() & BP Default / Standalone themes
------------------------------------+-------------------------------------
 Reporter:  imath                   |      Owner:
     Type:  defect (bug)            |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Theme / Template Parts  |    Version:  2.1
 Severity:  normal                  |   Keywords:  needs-codex 2nd-opinion
------------------------------------+-------------------------------------
 In BuddyPress 2.1 we've introduced the function
 {{{bp_activity_show_filters()}}}. The interest of this function is, as the
 [https://codex.buddypress.org/releases/version-2-1/ release note] details
 :
 "Activity dropdown filters are now dynamically generated instead of
 hardcoded into templates. See new function – bp_activity_show_filters()
 (#5637)"

 As BP Default is still using "hardcoded filters" into Activity dropdowns
 of the activity directory, single member's & group's home page, i can
 imagine child themes, and most of the standalone BuddyPress themes are
 also using the "hardcoded filters".

 At first, i thought: "we simply need to edit the BP Default templates that
 are concerned". But then i thought someone might use a theme with an old
 version of BuddyPress which can become complex to manage for a theme
 designer : if the theme is using the function in its template and the
 BuddyPress version is < 2.1 on the user's config, then it will trigger an
 error. (of course the theme could simply do a {{{if ( ! function_exists
 )}}} and eventually copy/paste the function to be sure it will be ok).

 From a plugin developer perspective {{{bp_activity_show_filters()}}} is
 really great because when setting the activity actions using
 {{{bp_activity_set_action()}}} you can avoid hooking
 'bp_activity_filter_options' and/or 'bp_group_activity_filter_options'
 and/or 'bp_member_activity_filter_options'. I've updated a
 [https://codex.buddypress.org/plugindev/bp_activity_add-2/#fully-enjoy-
 bp_activity_set_action codex page] about this point.

 Why talking about this now ? Because of the Post Types Activity tracking
 feature we're introducing in 2.2 > r9194. Part of this feature is about
 populating Activity Dropdowns and {{{bp_activity_show_filters()}}} is
 helping us dynamically do this on front-end. So i can imagine people using
 BP Default, a child theme, or a standalone theme write support topics
 asking "Why after adding the 'buddypress-activity' support to my post
 type, it's not listed into the Activity directory dropdown filters?"

 IMHO, i think a codex page talking about Activity dropdown filters in
 templates is an interesting reply.
 We could talk about the hooks and inform that since 2.1 it's possible to
 use {{{bp_activity_show_filters()}}}
 People asking such questions would have upgraded to 2.2 so i think it's
 then safest to explain how to create a specific activity directory
 template using a child theme for instance.

 Of course people using 2.2 bp-legacy template parts won't have any
 trouble.

 What do you think ?

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


More information about the buddypress-trac mailing list