wpseek.com
A WordPress-centric search engine for devs and theme authors



remove_all_filters › WordPress Function

Since2.7.0
Deprecatedn/a
remove_all_filters ( $hook_name, $priority = false )
Parameters: (2)
  • (string) $hook_name The filter to remove callbacks from.
    Required: Yes
  • (int|false) $priority Optional. The priority number to remove them from. Default false.
    Required: No
    Default: false
Returns:
  • (true) Always returns true.
Defined at:
Codex:

Removes all of the callback functions from a filter hook.



Source

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

	if ( isset( $wp_filter[ $hook_name ] ) ) {
		$wp_filter[ $hook_name ]->remove_all_filters( $priority );

		if ( ! $wp_filter[ $hook_name ]->has_filters() ) {
			unset( $wp_filter[ $hook_name ] );
		}
	}

	return true;
}