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

WordPress Trac noreply at wordpress.org
Wed Sep 6 16:49:57 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                                          |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 Just adding my 2 cents reading the above conversation, I'm also on board
 with the currently proposed signature of `$function_name, $message,
 $error_level = E_USER_NOTICE`.

 I would like us to come up with a clear method of differentiating between
 when to use `_doing_it_wrong()` vs when to use `wp_trigger_error()`
 though. I think it's clear the first one is to indicate to developers that
 they are doing something wrong. So by definition `wp_trigger_error()`
 probably covers the rest of errors. It would be great to come up with a
 list of examples, either anecdotally or maybe there are
 `_doing_it_wrong()` instances in core where we feel they should use
 `wp_trigger_error()` instead. Having such examples would help us better
 define the scope of when the new function should be used.

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


More information about the wp-trac mailing list