[buddypress-trac] [BuddyPress Trac] #6844: Extract & relocate core markup functions: Theme compat include functionality & search forms file

buddypress-trac noreply at wordpress.org
Fri Jan 29 11:43:07 UTC 2016


#6844: Extract & relocate core markup functions:  Theme compat include
functionality & search forms file
-----------------------------------------+------------------------------
 Reporter:  hnla                         |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Appearance - Template Parts  |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch dev-feedback       |
-----------------------------------------+------------------------------

Comment (by hnla):

 @boonebgorges
 >For brevity, I chose to use the same template tag for the 'name' and 'id'
 attributes.

 Yes it's the sensible approach and what I'd look to do always.

 The one problem I have though is in using the `bp_search_input_name()` tag
 we generate a string with underscores, I still cling to the convention of
 never using underscores in token strings only hyphens ( although I'm aware
 of the BEM take on using them which I have glanced over and pondered.).
 Given we would need to update the scsslint.yml to allow underscores -
 further than I have done already in allowing specific existing strings and
 given we are not following BEM principles in token naming I would prefer
 we stuck to hyphens.

 Rather than attempt to create yet another function, I tested:
 {{{
 id="<?php esc_attr_e(str_replace('_', '-', bp_get_search_input_name() ) );
 ?>-submit"
 }}}
 Using the get function and a str_replace - looks and feels cumbersome?

 So conversely considered going to the `bp_get_search_input_name()` and
 setting up a `bp_search_input_id()` version and doing a str replace there?

 Or alternative is we or I accept the use of underscores, bite my tongue
 and try not to mind - after all it doesn't actually break anything!

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6844#comment:10>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list