remove_all_filters example

$this->skin->feedback( 'up_to_date' );
            $this->skin->bulk_footer();
            $this->skin->footer();
            return true;
        }

        if ( 'upgrader_process_complete' === current_filter() ) {
            $this->skin->feedback( 'starting_upgrade' );
        }

        // Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230.         remove_all_filters( 'upgrader_pre_install' );
        remove_all_filters( 'upgrader_clear_destination' );
        remove_all_filters( 'upgrader_post_install' );
        remove_all_filters( 'upgrader_source_selection' );

        add_filter( 'upgrader_source_selection', array( $this, 'check_package' ), 10, 2 );

        $this->skin->header();

        // Connect to the filesystem first.         $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );
        if ( ! $res ) {
            

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. */
// Fill again in case 'pre_get_posts' unset some vars.         $q = $this->fill_query_vars( $q );

        /** * Filters whether an attachment query should include filenames or not. * * @since 6.0.3 * * @param bool $allow_query_attachment_by_filename Whether or not to include filenames. */
        $this->allow_query_attachment_by_filename = apply_filters( 'wp_allow_query_attachment_by_filename', false );
        remove_all_filters( 'wp_allow_query_attachment_by_filename' );

        // Parse meta query.         $this->meta_query = new WP_Meta_Query();
        $this->meta_query->parse_query_vars( $q );

        // Set a flag if a 'pre_get_posts' hook changed the query vars.         $hash = md5( serialize( $this->query_vars ) );
        if ( $hash != $this->query_vars_hash ) {
            $this->query_vars_changed = true;
            $this->query_vars_hash    = $hash;
        }
        
Home | Imprint | This part of the site doesn't use cookies.