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.

Built from https://develop.svn.wordpress.org/trunk@30379


git-svn-id: http://core.svn.wordpress.org/trunk@30376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-11-18 16:47:23 +00:00
parent 5945363d82
commit 5943966b69
1 changed files with 15 additions and 15 deletions

View File

@ -2328,31 +2328,31 @@ function wp_nonce_ays( $action ) {
/** /**
* Kill WordPress execution and display HTML message with error message. * 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 * 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 * only when the execution should not continue any further. It is not recommended
* recommended to call this function very often and try to handle as many errors * to call this function very often, and try to handle as many errors as possible
* as possible silently or more gracefully. * silently or more gracefully.
* *
* As a shorthand, the desired HTTP response code may be passed as an integer to * 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 * @since 2.0.4
* *
* @param string|WP_Error $message Optional. Error message. Default empty. * @param string|WP_Error $message Optional. Error message. If this is a {@see WP_Error} object,
* If this is a WP_Error object, the error's messages are used. * the error's messages are used. Default empty.
* @param string $title Optional. Error title. Default is a generic title. * @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object,
* If $message is a WP_Error object, error data with the key * error data with the key 'title' may be used to specify the title.
* 'title' may be used to specify the title. * Default empty.
* @param string|array|int $args { * @param string|array|int $args {
* Optional. Arguments to control behavior. Default empty array. * Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
* If $args is an integer, then it is treated as the response code. * as the response code. Default empty array.
* *
* @type int $response The HTTP response code. Default 500. * @type int $response The HTTP response code. Default 500.
* @type bool $back_link Whether to include a link to go back. Default false. * @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(). * @type string $text_direction The text direction. This is only useful internally, when WordPress
* Accepts 'rtl'. This is only useful internally, when WordPress * is still loading and the site's locale is not set up yet. Accepts 'rtl'.
* is still loading and the site's locale is not set up yet. * Default is the value of {@see is_rtl()}.
* } * }
*/ */
function wp_die( $message = '', $title = '', $args = array() ) { function wp_die( $message = '', $title = '', $args = array() ) {