WordPress.org

Make WordPress Core

Changeset 20037


Ignore:
Timestamp:
02/29/12 07:50:56 (6 years ago)
Author:
nacin
Message:

Use wp_get_theme() rather than get_theme_data() in the verify theme deletion (multisite network) screen. see #20103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/themes.php

    r19684 r20037  
    111111            $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 
    112112 
    113             if ( isset( $themes[ get_option( 'template' ) ] ) ) 
    114                 unset( $themes[ get_option( 'template' ) ] ); 
    115             if ( isset( $themes[ get_option( 'stylesheet' ) ] ) ) 
    116                 unset( $themes[ get_option( 'stylesheet' ) ] ); 
     113            unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] ); 
    117114 
    118115            if ( empty( $themes ) ) { 
     
    121118            } 
    122119 
    123             $main_theme = get_current_theme(); 
    124120            $files_to_delete = $theme_info = array(); 
    125121            foreach ( $themes as $key => $theme ) { 
    126                 $data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' ); 
    127                 if ( $data['Name'] == $main_theme ) { 
    128                     unset( $themes[$key] ); 
    129                 } else { 
    130                     $files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) ); 
    131                     $theme_info[ $theme ] = $data; 
    132                 } 
     122                $theme_info[ $theme ] = wp_get_theme( $theme ); 
     123                $files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) ); 
    133124            } 
    134125 
     
    156147                    <ul class="ul-disc"> 
    157148                        <?php foreach ( $theme_info as $theme ) 
    158                             echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html( $theme['Name'] ), esc_html( $theme['AuthorName'] ) ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?> 
     149                            echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), $theme->display('Name'), $theme->display('Author') ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?> 
    159150                    </ul> 
    160151                <p><?php _e('Are you sure you wish to delete these themes?'); ?></p> 
Note: See TracChangeset for help on using the changeset viewer.