From 0aef4faacdf166677e38a4a84249c786822d69d8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 27 Nov 2019 23:55:01 +0000 Subject: [PATCH] Plugins: Correct default value of `$replacement` parameter in `do_action_deprecated()` and `apply_filters_deprecated()`. This addresses an inconsistency with `_deprecated_hook()`, which uses `is_null()` to check if `$replacement` was provided, however the previous default value was `false`. Props shaampk1, felipeelia. Fixes #48817. Built from https://develop.svn.wordpress.org/trunk@46792 git-svn-id: http://core.svn.wordpress.org/trunk@46592 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 4 ++-- wp-includes/plugin.php | 10 +++++----- wp-includes/version.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 3ac199e1f0..6102da94f2 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4923,8 +4923,8 @@ function _deprecated_argument( $function, $version, $message = null ) { * * @param string $hook The hook that was used. * @param string $version The version of WordPress that deprecated the hook. - * @param string $replacement Optional. The hook that should have been used. - * @param string $message Optional. A message regarding the change. + * @param string $replacement Optional. The hook that should have been used. Default null. + * @param string $message Optional. A message regarding the change. Default null. */ function _deprecated_hook( $hook, $version, $replacement = null, $message = null ) { /** diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 97a1ffd588..66d2379655 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -620,10 +620,10 @@ function remove_all_actions( $tag, $priority = false ) { * @param string $tag The name of the filter hook. * @param array $args Array of additional function arguments to be passed to apply_filters(). * @param string $version The version of WordPress that deprecated the hook. - * @param string $replacement Optional. The hook that should have been used. Default false. + * @param string $replacement Optional. The hook that should have been used. Default null. * @param string $message Optional. A message regarding the change. Default null. */ -function apply_filters_deprecated( $tag, $args, $version, $replacement = false, $message = null ) { +function apply_filters_deprecated( $tag, $args, $version, $replacement = null, $message = null ) { if ( ! has_filter( $tag ) ) { return $args[0]; } @@ -647,10 +647,10 @@ function apply_filters_deprecated( $tag, $args, $version, $replacement = false, * @param string $tag The name of the action hook. * @param array $args Array of additional function arguments to be passed to do_action(). * @param string $version The version of WordPress that deprecated the hook. - * @param string $replacement Optional. The hook that should have been used. - * @param string $message Optional. A message regarding the change. + * @param string $replacement Optional. The hook that should have been used. Default null. + * @param string $message Optional. A message regarding the change. Default null. */ -function do_action_deprecated( $tag, $args, $version, $replacement = false, $message = null ) { +function do_action_deprecated( $tag, $args, $version, $replacement = null, $message = null ) { if ( ! has_action( $tag ) ) { return; } diff --git a/wp-includes/version.php b/wp-includes/version.php index c718515c90..cb66e0f818 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46791'; +$wp_version = '5.4-alpha-46792'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.