[wp-trac] [WordPress Trac] #41237: All error messages including core at one place

WordPress Trac noreply at wordpress.org
Wed Jul 5 09:36:05 UTC 2017


#41237: All error messages including core at one place
-----------------------------+-------------------------
 Reporter:  navalkishoregr   |       Owner:
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  General          |     Version:
 Severity:  normal           |  Resolution:  maybelater
 Keywords:                   |     Focuses:
-----------------------------+-------------------------
Changes (by jnylen0):

 * status:  new => closed
 * version:  4.8 =>
 * resolution:   => maybelater
 * milestone:  Awaiting Review =>


Comment:

 There is nothing stopping you from doing this in a plugin.  For example:

 {{{#!php
 <?php

 function myplugin_get_error( $code ) {
     switch ( $code ) {
         case 'not_allowed':
             return new WP_Error( 'not_allowed', __( 'This operation is not
 allowed.', 'myplugin' ) );
         case 'not_implemented':
             return new WP_Error( 'not_implemented', __( 'This operation is
 not implemented yet.', 'myplugin' ) );
     }
 }
 }}}

 It's possible that a pattern like this would also be a good fit for parts
 of core.

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


More information about the wp-trac mailing list