[wp-trac] [WordPress Trac] #19073: wp_die() can be a wrapper for WP_Error objects, but also triggers if no error is present

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 30 06:38:26 UTC 2011


#19073: wp_die() can be a wrapper for WP_Error objects, but also triggers if no
error is present
--------------------------+------------------------------
 Reporter:  F J Kaiser    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by OoroonBai):

 Why is it a senseless behavior? You can create errors without a message.

 {{{
 $error = new WP_Error( 'not_found', __('New error'), array( 'title' =>
 'Plugin Error', 'response' => '404', 'back_link' => true ) );
 if( is_wp_error( $error ) ){

         wp_die( $error, '', $error->get_error_data() );

 }
 }}}

 If someone translate the above string 'New error' with an empty string,
 than wp_die() would not not stop the script. But wp_die() should always
 stop the script when it is called.

 (Sorry for my pidgin english)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19073#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list