WordPress.org

Make WordPress Core

Ticket #18490: class-wp-upgrader.patch

File class-wp-upgrader.patch, 1.8 KB (added by sterlo, 3 years ago)

My first stab at a patch. svn diff > class-wp-upgrader.patch (root of trunk)

  • wp-admin/includes/class-wp-upgrader.php

     
    13511351 
    13521352                $install_actions = array( 
    13531353                        'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>', 
    1354                         'activate' => '<a href="' . $activate_link .  '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>' 
    1355                                                         ); 
     1354                        'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>' 
     1355                ); 
    13561356 
     1357                if( ! empty( $template ) ) { 
     1358                        global $wp_filesystem; 
     1359                        $themes_dir = $wp_filesystem->wp_themes_dir(); 
     1360                        $template_data = get_theme_data( $themes_dir . $template . '/style.css' ); 
     1361 
     1362                        if( empty( $template_data[ 'Name' ] ) ) { 
     1363                                unset( $install_actions[ 'activate' ] );  
     1364                                echo sprintf( __( 'Unable to locate the required parent theme: <strong>%1$s</strong>.<br />You will need to install the parent theme before being able to activate this theme.' ) , $template ); 
     1365                        } 
     1366                } 
     1367 
    13571368                if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) 
    13581369                        $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>'; 
    13591370 
     
    14581469                        $this->package = $uploads['basedir'] . '/' . $this->filename; 
    14591470                } 
    14601471        } 
    1461 } 
    1462  No newline at end of file 
     1472}