Make WordPress Core


Ignore:
Timestamp:
07/05/2020 09:07:48 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Consistently use an empty string as the default value for $replacement and $message parameters in:

  • _deprecated_function()
  • _deprecated_constructor()
  • _deprecated_file()
  • _deprecated_argument()
  • _deprecated_hook()
  • apply_filters_deprecated()
  • do_action_deprecated()

This matches the documented type of string for these parameters and removes unnecessarily strict ! is_null() checks.

Follow-up to [46792].

Props jignesh.nakrani, renathoc, SergeyBiryukov.
Fixes #49698.

File:
1 edited

Legend:

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

    r48109 r48327  
    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 null.
    624  * @param string $message     Optional. A message regarding the change. Default null.
    625  */
    626 function apply_filters_deprecated( $tag, $args, $version, $replacement = null, $message = null ) {
     623 * @param string $replacement Optional. The hook that should have been used. Default empty.
     624 * @param string $message     Optional. A message regarding the change. Default empty.
     625 */
     626function apply_filters_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {
    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. Default null.
    651  * @param string $message     Optional. A message regarding the change. Default null.
    652  */
    653 function do_action_deprecated( $tag, $args, $version, $replacement = null, $message = null ) {
     650 * @param string $replacement Optional. The hook that should have been used. Default empty.
     651 * @param string $message     Optional. A message regarding the change. Default empty.
     652 */
     653function do_action_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {
    654654    if ( ! has_action( $tag ) ) {
    655655        return;
Note: See TracChangeset for help on using the changeset viewer.