Changeset 49928
- Timestamp:
- 01/04/2021 04:56:20 PM (4 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-hook.php
r49927 r49928 188 188 * Checks if a specific action has been registered for this hook. 189 189 * 190 * When using the $function_to_checkargument, this function may return a non-boolean value191 * that evaluates to false (e.g. 0), so use the ===operator for testing the return value.190 * When using the `$function_to_check` argument, this function may return a non-boolean value 191 * that evaluates to false (e.g. 0), so use the `===` operator for testing the return value. 192 192 * 193 193 * @since 4.7.0 … … 195 195 * @param string $tag Optional. The name of the filter hook. Default empty. 196 196 * @param callable|false $function_to_check Optional. The callback to check for. Default false. 197 * @return false|int The priority of that hook is returned, or false if the function is not attached. 197 * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has 198 * anything registered. When checking a specific function, the priority of that 199 * hook is returned, or false if the function is not attached. 198 200 */ 199 201 public function has_filter( $tag = '', $function_to_check = false ) { -
trunk/src/wp-includes/plugin.php
r49927 r49928 122 122 123 123 /** 124 * Check if any filter has been registered for a hook. 124 * Checks if any filter has been registered for a hook. 125 * 126 * When using the `$function_to_check` argument, this function may return a non-boolean value 127 * that evaluates to false (e.g. 0), so use the `===` operator for testing the return value. 125 128 * 126 129 * @since 2.5.0 … … 130 133 * @param string $tag The name of the filter hook. 131 134 * @param callable|false $function_to_check Optional. The callback to check for. Default false. 132 * @return false|int If $function_to_check is omitted, returns boolean for whether the hook has 133 * anything registered. When checking a specific function, the priority of that 134 * hook is returned, or false if the function is not attached. When using the 135 * $function_to_check argument, this function may return a non-boolean value 136 * that evaluates to false (e.g. 0), so use the === operator for testing the 137 * return value. 135 * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has 136 * anything registered. When checking a specific function, the priority of that 137 * hook is returned, or false if the function is not attached. 138 138 */ 139 139 function has_filter( $tag, $function_to_check = false ) { … … 555 555 556 556 /** 557 * Check if any action has been registered for a hook. 557 * Checks if any action has been registered for a hook. 558 * 559 * When using the `$function_to_check` argument, this function may return a non-boolean value 560 * that evaluates to false (e.g. 0), so use the `===` operator for testing the return value. 558 561 * 559 562 * @since 2.5.0 … … 563 566 * @param string $tag The name of the action hook. 564 567 * @param callable|false $function_to_check Optional. The callback to check for. Default false. 565 * @return bool|int If $function_to_checkis omitted, returns boolean for whether the hook has568 * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has 566 569 * anything registered. When checking a specific function, the priority of that 567 * hook is returned, or false if the function is not attached. When using the 568 * $function_to_check argument, this function may return a non-boolean value 569 * that evaluates to false (e.g. 0), so use the === operator for testing the 570 * return value. 570 * hook is returned, or false if the function is not attached. 571 571 */ 572 572 function has_action( $tag, $function_to_check = false ) {
Note: See TracChangeset
for help on using the changeset viewer.