Title: WP_Hook::has_filters
Published: December 6, 2016
Last modified: May 20, 2026

---

# WP_Hook::has_filters(): bool

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#wp--skip-link--target)

Checks if any callbacks have been registered for this hook.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#return)󠁿

 bool True if callbacks have been registered for the current hook, otherwise false.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#source)󠁿

    ```php
    public function has_filters() {
    	foreach ( $this->callbacks as $callbacks ) {
    		if ( $callbacks ) {
    			return true;
    		}
    	}

    	return false;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-hook.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-hook.php#L271)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-hook.php#L271-L279)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Hook::has_filter()](https://developer.wordpress.org/reference/classes/wp_hook/has_filter/)`wp-includes/class-wp-hook.php` |

Checks if a specific callback has been registered for this hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_hook/has_filters/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_hook%2Fhas_filters%2F)
before being able to contribute a note or feedback.