Skip to:

Opened 3 years ago

Closed 6 weeks ago

#6109 closed enhancement (maybelater)

Re-factor BP template tags generating markup to parse args for attr/tokens

Reported by: hnla Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch, trac-tidy-2018


As discussed briefly: in slack this ticket is to cover the updating of those template tag functions that generate markup to accept arg arrays to allow devs/users to pass additional class tokens, and general html element attributes.
Two example functions that this might benefit from are:

bp_profile_group_tabs() to further extend the classes e.g adding .active in addition to .current.

bp_field_css_class( 'editfield' ); where attempting to pass an additional string into this function results in the two being concatenated with a hyphen.

The process will likely employ 'bp_parse_args()' to catch and merge args with any default ones set on a given function.

Initial steps required:

  1. List functions requiring attention?
  1. Decide on a suitable nonamclature for the array names/keys so we have meaningful/memorable names that make sense and suggest their purpose.
  1. Establish a suitable approach that is re-usable across functions?

The reasoning behind this is that there are often times where simple access to markup is required, an additional class being a perfect example. Where we have markup generation in core files access is not always straightforward, filtering is not always an option as can be too laboured for the level of requirement. With the increasing propensity for frameworks in themes/theme creation there will be an increased requirement to be able to make use of the styling classes provided as the quickest option for pulling markup into shape.

I'll happily make a first pass attempt at re-factoring an example function - probably profile group tabs - as a proof of concept once we have a tentative agreement on the process required.

Change History (4)

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

3 years ago

#2 @Paul Gibbs
3 years ago

  • Keywords dev-feedback removed
  • Milestone changed from 2.3 to Future Release

This sounds like a good set of improvements.

#3 @Paul Gibbs
6 weeks 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:

#4 @Paul Gibbs
6 weeks ago

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