[wp-trac] [WordPress Trac] #55962: Upgrade `sanitize_hex_color()` to CSS Color Level 4

WordPress Trac noreply at wordpress.org
Sat Jun 11 13:42:41 UTC 2022

#55962: Upgrade `sanitize_hex_color()` to CSS Color Level 4
 Reporter:  anrghg                        |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Formatting                    |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  css
Changes (by ocean90):

 * type:  defect (bug) => enhancement
 * milestone:  6.1 => Future Release


 I don't think `sanitize_hex_color()` can be extend as suggested as it's
 used for various color settings which do not allow more then 3 or 6 digit
 yet. Also, this would be unexpected for any plugin/theme which have some
 custom storage and simply cannot store more than 6 digits.

 Sounds more like a new function `sanitize_hex_with_alpha_color()` would be
 a option here.

Ticket URL: <https://core.trac.wordpress.org/ticket/55962#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list