By default and before WordPress 5.3, the handler for wp_die()
wraps error messages with a paragraph tag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.).
For a number of wp_die()
calls in WordPress, a plain text string is passed and the HTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. displayed is valid:
wp_die( 'This is an error message.' );
Currently returns:
<p>This is an error message.</p>.
However, for a number of other wp_die()
calls, the HTML displayed is invalid A resolution on the bug tracker (and generally common in software development, sometimes also notabug) that indicates the ticket is not a bug, is a support request, or is generally invalid. because paragraphs doesn’t allow every nesting possibility.
For example:
wp_die( '<h1>You need a higher level of permission.</h1><p>Sorry, you are not allowed to manage terms in this taxonomy.</p>' );
Currently returns:
<p><h1>You need a higher level of permission.</h1><p>Sorry, you are not allowed to manage terms in this taxonomy.</p></p>
With WordPress 5.3, error messages are wrapped in a <div>
rather than a <p>
, to better support string calls in wp_die()
, without
outputting invalid HTML.
These changes also add .wp-die-message
CSS Cascading Style Sheets. class for styling.
For example:
wp_die( '<h1>You need a higher level of permission.</h1><p>Sorry, you are not allowed to manage terms in this taxonomy.</p>' );
Will now return:
<div class="wp-die-message">
<h1>You need a higher level of permission.</h1>
<p>Sorry, you are not allowed to manage terms in this taxonomy.</p>
</div>
Plugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party authors are encouraged to check their use of wp_die()
and update their PHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher calls to the function or their CSS styles if needed.
For reference, see Trac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticket Created for both bug reports and feature development on the bug tracker. #47580.
#5-3, #dev-notes