summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-04-22 15:33:38 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-04-22 15:33:38 +0000
commitd9534e104b92cb8a68ae31dbe92ba5d4d20f1deb (patch)
treeb9c1574c9883ca5587acbecbf6c2fab42ae7e282 /src
parenta1bce5f880b7c7b125f92fa468c2adedd354ece5 (diff)
downloadwordpress-d9534e104b92cb8a68ae31dbe92ba5d4d20f1deb.tar.gz
wordpress-d9534e104b92cb8a68ae31dbe92ba5d4d20f1deb.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/wp-includes/plugin.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php
index 77c1eb4ef6..bed67a9d96 100644
--- a/src/wp-includes/plugin.php
+++ b/src/wp-includes/plugin.php
@@ -984,7 +984,8 @@ function _wp_call_all_hook( $args ) {
* or may not exist.
* @param int $priority Unused. The order in which the functions
* associated with a particular action are executed.
- * @return string Unique function ID for usage as array key.
+ * @return string|null Unique function ID for usage as array key.
+ * Null if a valid `$callback` is not passed.
*/
function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
if ( is_string( $callback ) ) {
@@ -1005,4 +1006,6 @@ function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
// Static calling.
return $callback[0] . '::' . $callback[1];
}
+
+ return null;
}