[buddypress-trac] [BuddyPress Trac] #6679: Allow bp_field_css_class() to accept more than one class name.

buddypress-trac noreply at wordpress.org
Fri Nov 13 02:53:54 UTC 2015


#6679: Allow bp_field_css_class() to accept more than one class name.
----------------------------------------+-----------------------
 Reporter:  dcavins                     |       Owner:  dcavins
     Type:  enhancement                 |      Status:  accepted
 Priority:  normal                      |   Milestone:  2.5
Component:  Component - XProfile        |     Version:  2.3.3
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |
----------------------------------------+-----------------------

Comment (by sbrajesh):

 @dcavins
 There are multiple reasons.
 In the patch you are exploding on comma (') not on space. That was my
 first concern.

 Even if you used space, there are issues. If you use space instead of
 regular expression you are expecting that there should be  limiting to
 simple space while regexp will work whether there is one space between the
 class or multiple.

 Another thing is if you use space, you will need to filter out your array
 for empty value.

 Here is an example:-
 {{{#!php
 <?php
 $test = " a   b c d   e";
 $test = explode ( " ", $test );
 var_dump($test);
 }}}
 See the result and you will see why it is more suitable to use regexp.
 Hope that clarifies.

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


More information about the buddypress-trac mailing list