[wp-trac] [WordPress Trac] #57686: Introduce wp_trigger_error() to compliment _doing_it_wrong()

WordPress Trac noreply at wordpress.org
Wed Sep 13 16:16:50 UTC 2023


#57686: Introduce wp_trigger_error() to compliment _doing_it_wrong()
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:
                                                 |  hellofromTonya
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-dev-note has-patch has-unit-   |     Focuses:
  tests commit                                   |
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 @peterwilsoncc [attachment:"_doing_it_wrong_example.png"] is an example in
 the browser of `_doing_it_wrong()` with and without escaping the message
 passed to `trigger_error()`. Notice that with escaping, the linked article
 is no longer selectable. It looks like this in the server log:

 {{{
 [13-Sep-2023 15:58:32 UTC] PHP Notice:  Function
 test_escaping_of_trigger_error was called
 <strong>incorrectly</strong>. A non-empty string is required
 for blah. Please see <a
 href="https://wordpress.org/documentation/article/debugging-in-
 wordpress/">Debugging in WordPress</a> for more information.
 (This message was added in version 6.4.) in /var/www/src/wp-
 includes/functions.php on line 6080
 }}}

 What do you think of how it displays when escaping both in the browser and
 logs? Do you think it's less readable? If yes, do you think it's
 problematic?

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


More information about the wp-trac mailing list