[wp-trac] [WordPress Trac] #19100: Introduce esc_color()

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 1 14:14:00 UTC 2011


#19100: Introduce esc_color()
------------------------------------+------------------------------
 Reporter:  mfields                 |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  General                 |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by GaryJ):

 I agree with westi - this shouldn't be included unless `rgb()`, `rgba()`,
 `hsl()` and `hsla()` formats are included. Just because a rough draft of
 some coding standards (which as we know, WP doesn't follow to the letter
 anyway) says only to use hex colours, doesn't mean you shouldn't support
 all formats, if it's intended to be used by theme developers.

 I'd support inclusion of this, if it was `esc_color_hex()`, with the other
 formats being added as individual functions too, along with a master
 `esc_color()` that checked the string against each of the formats until
 one was found, that way, a theme developer *could* be more specific and
 only accept hex colours, *or*, could accept colours in any format.

 Also, what about color keywords, or currentColor, or the deprecated (for
 CSS3, but still valid at CSS2) system colours?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19100#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list