Ensure the mixed type of `string|int` is reflected on the `$title` parameter in `wp_die()`.
The ability to pass an error code as short-hand to the `$title` and `$args` parameters was added in r30355. Changes also include cleaned-up formatting and line-wraps for other documentation in the DocBlock. See [30355]. Fixes #10551. git-svn-id: https://develop.svn.wordpress.org/trunk@30379 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8c25a14aa0
commit
aa2c1e6e73
|
@ -2328,31 +2328,31 @@ function wp_nonce_ays( $action ) {
|
|||
/**
|
||||
* Kill WordPress execution and display HTML message with error message.
|
||||
*
|
||||
* This function complements the die() PHP function. The difference is that
|
||||
* This function complements the `die()` PHP function. The difference is that
|
||||
* HTML will be displayed to the user. It is recommended to use this function
|
||||
* only when the execution should not continue any further. It is not
|
||||
* recommended to call this function very often and try to handle as many errors
|
||||
* as possible silently or more gracefully.
|
||||
* only when the execution should not continue any further. It is not recommended
|
||||
* to call this function very often, and try to handle as many errors as possible
|
||||
* silently or more gracefully.
|
||||
*
|
||||
* As a shorthand, the desired HTTP response code may be passed as an integer to
|
||||
* the $title parameter (the default title would apply) or the $args parameter.
|
||||
* the `$title` parameter (the default title would apply) or the `$args` parameter.
|
||||
*
|
||||
* @since 2.0.4
|
||||
*
|
||||
* @param string|WP_Error $message Optional. Error message. Default empty.
|
||||
* If this is a WP_Error object, the error's messages are used.
|
||||
* @param string $title Optional. Error title. Default is a generic title.
|
||||
* If $message is a WP_Error object, error data with the key
|
||||
* 'title' may be used to specify the title.
|
||||
* @param string|WP_Error $message Optional. Error message. If this is a {@see WP_Error} object,
|
||||
* the error's messages are used. Default empty.
|
||||
* @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object,
|
||||
* error data with the key 'title' may be used to specify the title.
|
||||
* Default empty.
|
||||
* @param string|array|int $args {
|
||||
* Optional. Arguments to control behavior. Default empty array.
|
||||
* If $args is an integer, then it is treated as the response code.
|
||||
* Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
|
||||
* as the response code. Default empty array.
|
||||
*
|
||||
* @type int $response The HTTP response code. Default 500.
|
||||
* @type bool $back_link Whether to include a link to go back. Default false.
|
||||
* @type string $text_direction The text direction. Defaults to the value of is_rtl().
|
||||
* Accepts 'rtl'. This is only useful internally, when WordPress
|
||||
* is still loading and the site's locale is not set up yet.
|
||||
* @type string $text_direction The text direction. This is only useful internally, when WordPress
|
||||
* is still loading and the site's locale is not set up yet. Accepts 'rtl'.
|
||||
* Default is the value of {@see is_rtl()}.
|
||||
* }
|
||||
*/
|
||||
function wp_die( $message = '', $title = '', $args = array() ) {
|
||||
|
|
Loading…
Reference in New Issue