has_filters example


    public function has_filter( $hook_name = '', $callback = false ) {
        if ( false === $callback ) {
            return $this->has_filters();
        }

        $function_key = _wp_filter_build_unique_id( $hook_name$callback, false );

        if ( ! $function_key ) {
            return false;
        }

        foreach ( $this->callbacks as $priority => $callbacks ) {
            if ( isset( $callbacks[ $function_key ] ) ) {
                return $priority;
            }

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

/** * Retrieves the name of the current filter hook. * * @since 2.5.0 * * @global string[] $wp_current_filter Stores the list of current filters with the current one last * * @return string Hook name of the current filter. */
Home | Imprint | This part of the site doesn't use cookies.