WordPress at a glance

remove_all_filters() WP 1.0

Remove all of the hooks from a filter.

  • Global. Array. $wp_filter Stores all of the filters

No Hooks.

Return

true. True when finished.

Usage

remove_all_filters( $tag, $priority );
$tag(string) (required)
The filter to remove hooks from.
$priority(int/true/false)
The priority number to remove.
Default: false

Code of remove_all_filters: wp-includes/plugin.php VER 5.0.1

<?php
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;
}

Related Functions

From tag: Filters (hooks)

More from category: Hooks (actions, filters)

No comments
    Hello, !     Log In . Register