A WordPress-centric search engine for devs and theme authors



remove_all_filters ›

Since2.7.0
Deprecatedn/a
remove_all_filters ( $tag, $priority = false )
Parameters: (2)
  • (string) $tag The filter to remove hooks from.
    Required: Yes
  • (int|bool) $priority Optional. The priority number to remove. Default false.
    Required: No
    Default: false
Returns:
  • (true) True when finished.
Defined at:
Codex:

Remove all of the hooks from a filter.



Source

function remove_all_filters( $tag, $priority = false ) {
	global $wp_filter;

	if ( isset( $wp_filter[ $tag ] ) ) {
		$wp_filter[ $tag ]->remove_all_filters( $priority );
		if ( ! $wp_filter[ $tag ]->has_filters() ) {
			unset( $wp_filter[ $tag ] );
		}
	}

	return true;
}