[buddypress-trac] [BuddyPress Trac] #6109: Re-factor BP template tags generating markup to parse args for attr/tokens

buddypress-trac noreply at wordpress.org
Sun Jan 11 17:45:37 UTC 2015

#6109: Re-factor BP template tags generating markup to parse args for attr/tokens
 Reporter:  hnla         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  2.3
Component:  Core         |    Version:
 Severity:  normal       |   Keywords:  needs-patch dev-feedback
 As discussed briefly:
 https://wordpress.slack.com/archives/buddypress/p1420987468000060 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?

 2. Decide on a suitable nonamclature for the array names/keys so we have
 meaningful/memorable  names that make sense and suggest their purpose.

 3. 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.

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

More information about the buddypress-trac mailing list