Opened 13 months ago
Last modified 13 months ago
#58987 new enhancement
Unify usage of die(), die( '-1' ), exit();
Reported by: | Presskopp | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | |
Component: | General | Keywords: | needs-dev-note |
Focuses: | coding-standards | Cc: |
Description
like mentioned here I'd like to know if we want to unify the different die() calls we use:
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
(mostly used, having a comment)
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
if ( ! defined( 'ABSPATH' ) ) {
exit();
}
like seen in \wp-includes\rss-functions.php
Change History (1)
Note: See
TracTickets for help on using
tickets.
Based on this theory, I guess we should consider using die() everywhere instead of exit of die(-1).
Also, I don't think it's a bug, could go as a code enhancement.