[wp-trac] [WordPress Trac] #58987: Unify usage of die(), die( '-1' ), exit();

WordPress Trac noreply at wordpress.org
Sun Aug 6 09:46:23 UTC 2023


#58987: Unify usage of die(), die( '-1' ), exit();
--------------------------+-----------------------------
 Reporter:  Presskopp     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 like mentioned
 [[https://core.trac.wordpress.org/ticket/58420#comment:6|here]] I'd like
 to know if we want to unify the different die() calls we use:

 {{{#!php
 // Don't load directly.
 if ( ! defined( 'ABSPATH' ) ) {
         die( '-1' );
 }
 }}}

 (mostly used, having a comment)

 {{{#!php
 if ( ! defined( 'ABSPATH' ) ) {
         die();
 }
 }}}

 (**not** having a comment), like seen in **\wp-admin\link-parse-
 opml.php**, **\wp-admin\site-health-info.php**

 or even

 {{{#!php
 if ( ! defined( 'ABSPATH' ) ) {
         exit();
 }
 }}}

 like seen in **\wp-includes\rss-functions.php**

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58987>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list