Make WordPress Core


Ignore:
Timestamp:
03/13/2010 03:59:40 AM (15 years ago)
Author:
dd32
Message:

Bulk Theme Upgrades. See #12528 See #11232 for Bulk UI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/update.php

    r13602 r13686  
    4343
    4444        iframe_footer();
    45         exit;
    4645           
    4746    } elseif ( 'upgrade-plugin' == $action ) {
     
    164163
    165164        include('admin-footer.php');
    166 
     165    } elseif ( 'update-selected-themes' == $action ) {
     166        if ( ! current_user_can( 'update_themes' ) )
     167            wp_die( __( 'You do not have sufficient permissions to update themes for this blog.' ) );
     168
     169        check_admin_referer( 'bulk-update-themes' );
     170
     171        if ( isset( $_GET['themes'] ) )
     172            $themes = explode( ',', stripslashes($_GET['themes']) );
     173        elseif ( isset( $_POST['checked'] ) )
     174            $themes = (array) $_POST['checked'];
     175        else
     176            $themes = array();
     177
     178        $themes = array_map('urldecode', $themes);
     179
     180        $url = 'update.php?action=update-selected-themes&themess=' . urlencode(implode(',', $themes));
     181        $nonce = 'bulk-update-themes';
     182
     183        require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
     184        wp_enqueue_script('jquery');
     185        iframe_header();
     186
     187        $upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
     188        $upgrader->bulk_upgrade( $themes );
     189
     190        iframe_footer();
    167191    } elseif ( 'install-theme' == $action ) {
    168192
Note: See TracChangeset for help on using the changeset viewer.