From f0bb2bc3c0191a52ce00fdfb110895db395488b9 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 4 Sep 2016 03:41:31 +0000 Subject: [PATCH] Docs: Update the `$message` parameter for `_default_wp_die_handler()` to notate that it can also accept a `WP_Error` object. Additionally, update the `$message` parameter description in the DocBlock for `wp_die()` to make it explicitly clear messages derived from a passed `WP_Error` object will only be evaluated if not performing an Ajax or XML-RPC request (as both default handlers completely ignore `WP_Error` object messages). See #37770. Built from https://develop.svn.wordpress.org/trunk@38518 git-svn-id: http://core.svn.wordpress.org/trunk@38459 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 9 +++++---- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e3f2560a2a..bcb930e183 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2572,7 +2572,8 @@ function wp_nonce_ays( $action ) { * an integer to be used as the response code. * * @param string|WP_Error $message Optional. Error message. If this is a WP_Error object, - * the error's messages are used. Default empty. + * and not an Ajax or XML-RPC request, 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. * If `$title` is an integer, then it is treated as the response @@ -2638,9 +2639,9 @@ function wp_die( $message = '', $title = '', $args = array() ) { * @since 3.0.0 * @access private * - * @param string $message Error message. - * @param string $title Optional. Error title. Default empty. - * @param string|array $args Optional. Arguments to control behavior. Default empty array. + * @param string|WP_Error $message Error message or WP_Error object. + * @param string $title Optional. Error title. Default empty. + * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _default_wp_die_handler( $message, $title = '', $args = array() ) { $defaults = array( 'response' => 500 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1766e0f642..a84cc791d3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38517'; +$wp_version = '4.7-alpha-38518'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.