Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#6052 closed enhancement (fixed)

bp_activity_show_filters() & BP Default / Standalone themes

Reported by: imath Owned by:
Milestone: BuddyPress.org Sites Priority: normal
Severity: normal Version: 2.1
Component: Templates Keywords: needs-codex 2nd-opinion
Cc:

Description

In BuddyPress 2.1 we've introduced the function bp_activity_show_filters(). The interest of this function is, as the 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 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 ?

Change History (11)

#1 @imath
6 years ago

  • Type changed from defect (bug) to task

#2 @boonebgorges
6 years ago

IMHO, i think a codex page talking about Activity dropdown filters in templates is an interesting reply.

+1. You're right that we should inform users about the change, and this is a good way to do it. As you note, we should *not* update bp-default to support this natively.

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


6 years ago

#4 @imath
6 years ago

thanks a lot boonebgorges for your feedback :)

#5 @hnla
6 years ago

+1 for codex page - which sets me thinking we perhaps need a distinct approach to having a section perhaps labelled 'Theme Updates / Revisions' where we would allude by version number to any functionality that requires theme mods and link to article guide to updating.

BP Default, a child theme, or a standalone theme

However of these types only bp-default and standalone should present an issue? Child themes as they stand run from theme compat legacy files.

#6 @imath
6 years ago

Thanks hnla, i was thinking about a BP Default child theme actually. I think the section is a good idea. I'm going to work on a draft page for the codex and will keep you updated.

#7 @imath
6 years ago

Just Created the codex page (14455) "Activity dropdown filters in templates" in draft mode.
hnla & mercime, if you could have a look on it and choose the best place for it in the toc, that would be awesome :)

#8 @hnla
6 years ago

We'll publish it to Themes (BuddyPress Theme Development) top level initially to get it out there but may move it under a theme updating section possibly ( or just create a new tax/tag for articles of this type), depending on views.

#9 @imath
6 years ago

  • Milestone changed from Awaiting Review to BuddyPress.org
  • Resolution set to fixed
  • Status changed from new to closed

Thanks a lot hnla :)

#10 @DJPaul
4 years ago

  • Component changed from Appearance - Template Parts to Templates

#11 @DJPaul
4 years ago

  • Type changed from task to enhancement
Note: See TracTickets for help on using tickets.