Skip to:

Opened 11 years ago

Closed 6 years ago

#5174 closed enhancement (maybelater)

Depending on the context, group name should not be filterable

Reported by: imath's profile imath Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.8.1
Component: Groups Keywords: needs-refresh, trac-tidy-2018


As announced in #5173, i think it might be interesting to avoid the group name to be filterable by plugins in some contexts :

  • when used inside of a title attribute of links
  • when used in an edit field
  • when used in a select option
  • when used in the title attribute of the rss feed

So far any plugin can filter 'bp_get_group_name' and eventually add some extra html to it after the sanitizing filters occurred (like i do in BP Sticky Groups! sorry :( )

So i think 2 new template tags should be used to avoid the group name to be filtered by plugins in the 4 cases i've listed above.

I've included my suggestion in the attached diff.

Attachments (1)

5174.diff (11.2 KB) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (9)

11 years ago

#1 @imath
11 years ago

  • Keywords has-patch 2nd-opinion added

#2 @boonebgorges
11 years ago

A few thoughts on the proposal:

  1. IMHO (emphasis on "H" :) ), your technique in bp-sticky-groups is a bit hackish, and not something we want to encourage. The bp_get_group_name filter is for *the group name*; you are changing it to add markup, which is something beyond the name itself. I know that BP is not making it very easy for you to work here :), but hopefully the changes in #5173 will make it easier (you can then do .sticky-group .item-title a in your CSS, or something like that).
  1. I agree that there are some places where it might be argued that we don't want to apply exactly the same filters to the group name. The case of title attributes is one interesting case, if for no other reason that we have to escape it differently. However, instead of *removing* filters altogether, I think the most WordPress-ish way to solve the problem is to have *separate template functions* for these areas, with different filters.

What do you think?

#3 @imath
11 years ago

Replying to boonebgorges:

What do you think?

About 1 ( < thanks again for this one!! ) and 2 : I agree at 100% !!

My first description is a bit confusing. Actually, in 5174.diff i do not touch to bp_get_group_name, i create 2 new template tags bp_group_title() (which echoes bp_get_group_title() ) and bp_current_group_title() (which echoes bp_get_current_group_title() )

These 2 new functions don't use apply_filters() to be sure no plugin or theme can play with it, they just apply the formatting functions that are used for bp_get_group_name().

#4 follow-up: @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to 2.0

Putting this in 2.0 milestone -- @imath, interested in getting some more feedback on your proposed changes and working to get them into 2.0?

#5 in reply to: ↑ 4 @imath
10 years ago

Replying to DJPaul:

Putting this in 2.0 milestone -- @imath, interested in getting some more feedback on your proposed changes and working to get them into 2.0?

Yes i am :)

#6 @boonebgorges
10 years ago

  • Keywords needs-refresh added; has-patch 2nd-opinion removed
  • Milestone changed from 2.0 to Future Release

#7 @DJPaul
6 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see
or find us on Slack, in the #buddypress channel:

#8 @DJPaul
6 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.