Make WordPress Core


Ignore:
Timestamp:
04/22/2025 03:33:38 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Explicitly return null in _wp_filter_build_unique_id().

This commit updates the function to explicitly return null if a valid $callback is not passed. Previously, the function could return void, but was typed as only returning a string.

Follow-up to [5936], [11409], [12090], [46220], [46801], [50807], [52300].

Props justlevine.
See #63268.

File:
1 edited

Legend:

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

    r55893 r60179  
    985985 * @param int                   $priority  Unused. The order in which the functions
    986986 *                                         associated with a particular action are executed.
    987  * @return string Unique function ID for usage as array key.
     987 * @return string|null Unique function ID for usage as array key.
     988 *                     Null if a valid `$callback` is not passed.
    988989 */
    989990function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
     
    10061007        return $callback[0] . '::' . $callback[1];
    10071008    }
    1008 }
     1009
     1010    return null;
     1011}
Note: See TracChangeset for help on using the changeset viewer.