Make WordPress Core


Ignore:
Timestamp:
11/18/2014 04:46:36 PM (10 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r30356 r30379  
    23292329 * Kill WordPress execution and display HTML message with error message.
    23302330 *
    2331  * This function complements the die() PHP function. The difference is that
     2331 * This function complements the `die()` PHP function. The difference is that
    23322332 * HTML will be displayed to the user. It is recommended to use this function
    2333  * only when the execution should not continue any further. It is not
    2334  * recommended to call this function very often and try to handle as many errors
    2335  * as possible silently or more gracefully.
     2333 * only when the execution should not continue any further. It is not recommended
     2334 * to call this function very often, and try to handle as many errors as possible
     2335 * silently or more gracefully.
    23362336 *
    23372337 * As a shorthand, the desired HTTP response code may be passed as an integer to
    2338  * the $title parameter (the default title would apply) or the $args parameter.
     2338 * the `$title` parameter (the default title would apply) or the `$args` parameter.
    23392339 *
    23402340 * @since 2.0.4
    23412341 *
    2342  * @param string|WP_Error  $message Optional. Error message. Default empty.
    2343  *                                  If this is a WP_Error object, the error's messages are used.
    2344  * @param string           $title   Optional. Error title. Default is a generic title.
    2345  *                                  If $message is a WP_Error object, error data with the key
    2346  *                                  'title' may be used to specify the title.
     2342 * @param string|WP_Error  $message Optional. Error message. If this is a {@see WP_Error} object,
     2343 *                                  the error's messages are used. Default empty.
     2344 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
     2345 *                                  error data with the key 'title' may be used to specify the title.
     2346 *                                  Default empty.
    23472347 * @param string|array|int $args {
    2348  *     Optional. Arguments to control behavior. Default empty array.
    2349  *     If $args is an integer, then it is treated as the response code.
     2348 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
     2349 *     as the response code. Default empty array.
    23502350 *
    23512351 *     @type int    $response       The HTTP response code. Default 500.
    23522352 *     @type bool   $back_link      Whether to include a link to go back. Default false.
    2353  *     @type string $text_direction The text direction. Defaults to the value of is_rtl().
    2354  *                                  Accepts 'rtl'. This is only useful internally, when WordPress
    2355  *                                  is still loading and the site's locale is not set up yet.
     2353 *     @type string $text_direction The text direction. This is only useful internally, when WordPress
     2354 *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
     2355 *                                  Default is the value of {@see is_rtl()}.
    23562356 * }
    23572357 */
Note: See TracChangeset for help on using the changeset viewer.