Make WordPress Core

Changeset 46792

Timestamp:
11/27/2019 11:53:31 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r46660 r46792  
    49244924 * @param string $hook        The hook that was used.
    49254925 * @param string $version     The version of WordPress that deprecated the hook.
    4926  * @param string $replacement Optional. The hook that should have been used.
    4927  * @param string $message     Optional. A message regarding the change.
     4926 * @param string $replacement Optional. The hook that should have been used.
     4927 * @param string $message     Optional. A message regarding the change.
    49284928 */
    49294929function _deprecated_hook( $hook, $version, $replacement = null, $message = null ) {
  • trunk/src/wp-includes/plugin.php

    r46689 r46792  
    621621 * @param array  $args        Array of additional function arguments to be passed to apply_filters().
    622622 * @param string $version     The version of WordPress that deprecated the hook.
    623  * @param string $replacement Optional. The hook that should have been used. Default false.
     623 * @param string $replacement Optional. The hook that should have been used. Default .
    624624 * @param string $message     Optional. A message regarding the change. Default null.
    625625 */
    626 function apply_filters_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
     626function apply_filters_deprecated( $tag, $args, $version, $replacement = , $message = null ) {
    627627    if ( ! has_filter( $tag ) ) {
    628628        return $args[0];
     
    648648 * @param array  $args        Array of additional function arguments to be passed to do_action().
    649649 * @param string $version     The version of WordPress that deprecated the hook.
    650  * @param string $replacement Optional. The hook that should have been used.
    651  * @param string $message     Optional. A message regarding the change.
    652  */
    653 function do_action_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
     650 * @param string $replacement Optional. The hook that should have been used.
     651 * @param string $message     Optional. A message regarding the change.
     652 */
     653function do_action_deprecated( $tag, $args, $version, $replacement = , $message = null ) {
    654654    if ( ! has_action( $tag ) ) {
    655655        return;
Note: See TracChangeset for help on using the changeset viewer.