wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



remove_all_filters › WordPress Function

Od2.7.0
Przestarzałyn/a
remove_all_filters ( $hook_name, $priority = false )
Parametry: (2)
  • (string) $hook_name The filter to remove callbacks from.
    Wymagane: Tak
  • (int|false) $priority Optional. The priority number to remove them from. Default false.
    Wymagane: Nie
    Domyślny: false
Powrót:
  • (true) Always returns true.
Zdefiniowane na:
Codex:

Removes all of the callback functions from a filter hook.



Źródło

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