From 7dd4e29b66c4b207f7adc791576e222e9508954d Mon Sep 17 00:00:00 2001 From: Debarghya Banerjee Date: Mon, 26 May 2025 02:57:50 +0530 Subject: [PATCH 1/2] Update return doc to String|False --- src/wp-includes/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index bed67a9d9641c..09e8f81292212 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -359,7 +359,7 @@ function remove_all_filters( $hook_name, $priority = false ) { * * @global string[] $wp_current_filter Stores the list of current filters with the current one last * - * @return string Hook name of the current filter. + * @return string|false Hook name of the current filter. */ function current_filter() { global $wp_current_filter; @@ -632,7 +632,7 @@ function remove_all_actions( $hook_name, $priority = false ) { * * @since 3.9.0 * - * @return string Hook name of the current action. + * @return string|false Hook name of the current action. */ function current_action() { return current_filter(); From 67ed2bb08c0a908acfd73819cbc8f5ee1bb11309 Mon Sep 17 00:00:00 2001 From: Debarghya Banerjee Date: Mon, 26 May 2025 12:00:58 +0530 Subject: [PATCH 2/2] Updated the document --- src/wp-includes/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index 09e8f81292212..74d60448c7f3b 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -359,7 +359,7 @@ function remove_all_filters( $hook_name, $priority = false ) { * * @global string[] $wp_current_filter Stores the list of current filters with the current one last * - * @return string|false Hook name of the current filter. + * @return string|false Hook name of the current filter, false if no filter running. */ function current_filter() { global $wp_current_filter; @@ -632,7 +632,7 @@ function remove_all_actions( $hook_name, $priority = false ) { * * @since 3.9.0 * - * @return string|false Hook name of the current action. + * @return string|false Hook name of the current action, false if no action running. */ function current_action() { return current_filter();