Skip to content

Commit f0416ae

Browse files
committed
chore: explicitly return null for _wp_filter_build_unique_id()
1 parent e6416a7 commit f0416ae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/wp-includes/plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ function _wp_call_all_hook( $args ) {
984984
* or may not exist.
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.
988988
*/
989989
function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
990990
if ( is_string( $callback ) ) {
@@ -1005,4 +1005,7 @@ function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
10051005
// Static calling.
10061006
return $callback[0] . '::' . $callback[1];
10071007
}
1008+
1009+
// Return null if the callback is not callable.
1010+
return null;
10081011
}

0 commit comments

Comments
 (0)