Skip to content

Commit d9534e1

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@60179 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a1bce5f commit d9534e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wp-includes/plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,8 @@ 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.
988+
* Null if a valid `$callback` is not passed.
988989
*/
989990
function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
990991
if ( is_string( $callback ) ) {
@@ -1005,4 +1006,6 @@ function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
10051006
// Static calling.
10061007
return $callback[0] . '::' . $callback[1];
10071008
}
1009+
1010+
return null;
10081011
}

0 commit comments

Comments
 (0)