[wp-trac] [WordPress Trac] #44941: Support `warning` and `info` type notices in settings errors

WordPress Trac noreply at wordpress.org
Wed Aug 21 13:24:45 UTC 2019


#44941: Support `warning` and `info` type notices in settings errors
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.3
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-screenshots needs-     |     Focuses:
  dev-note                                       |  administration
-------------------------------------------------+-------------------------
Changes (by afercia):

 * keywords:  has-patch has-screenshots => has-patch has-screenshots needs-
     dev-note


Comment:

 Minor: worth noting the changes in [45814] break plugins that are (with
 good intent) passing a proper CSS class. For example, if a plugin passes
 `notice-error`, the CSS class printed out will now be `notice-notice-
 error`. Maybe worth considering a quick dev note. See also #44640.

 Yes, the previous documentation mentioned `Accepts 'error' or 'updated'`
 but there was nothing in the code to prevent to pass arbitrary class
 names. Even in the new code there's nothing to prevent it.

 Also, one could pass a string like the following:

 `error my-own-css-class hello world`

 and actually get the following (spaces are stripped out by
 `sanitize_html_class()`):

 `notice notice-errormy-own-css-classhelloworld settings-error is-
 dismissible`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44941#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list