wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



remove_all_filters › WordPress Function

Seit2.7.0
Veraltetn/v
remove_all_filters ( $hook_name, $priority = false )
Parameter: (2)
  • (string) $hook_name The filter to remove callbacks from.
    Erforderlich: Ja
  • (int|false) $priority Optional. The priority number to remove them from. Default false.
    Erforderlich: Nein
    Standard: false
Gibt zurück:
  • (true) Always returns true.
Definiert in:
Codex:

Removes all of the callback functions from a filter hook.



Quellcode

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