| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | public static function register( string $hook_type, string $hook_name, callable $callback, int $priority = 10, int $args = 1 ): bool { |
| 40 | 40 | if ( ! in_array( $hook_type, array( 'action', 'filter' ), true ) ) { |
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | - if ( empty( trim( $hook_name ) ) ) { | |
| 43 | + if ( empty( trim( $hook_name, " \t\n\r\0\x0B" ) ) ) { | |
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | if ( $priority < 0 ) { |
| 47 | 47 | return false; |
| @@ -162,9 +162,9 @@ | ||
| 162 | 162 | * @param string $hook_name The hook name. |
| 163 | 163 | * @param callable $callback The callback function. |
| 164 | 164 | * @param int $priority Priority of the hook. |
| 165 | 165 | * |
| 166 | - * @return bool True if removed, false if not found or invalid hook. | |
| 166 | + * @return bool True if removed, false if not found or removal failed. | |
| 167 | 167 | */ |
| 168 | 168 | public static function remove_action( $hook_name, $callback, $priority = 10 ) { |
| 169 | 169 | return self::remove( 'action', $hook_name, $callback, $priority ); |
| 170 | 170 | } |