WordPress.org

Make WordPress Core

Ticket #40764: 40764.2.diff

File 40764.2.diff, 752 bytes (added by swissspidy, 3 years ago)
  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index 33276d26fa..8a4105a7f0 100644
    function wp_ajax_update_theme() { 
    34853485        $status     = array(
    34863486                'update'     => 'theme',
    34873487                'slug'       => $stylesheet,
     3488                'oldVersion' => '',
    34883489                'newVersion' => '',
    34893490        );
    34903491
    function wp_ajax_update_theme() { 
    34933494                wp_send_json_error( $status );
    34943495        }
    34953496
     3497        $theme = wp_get_theme( $stylesheet );
     3498
     3499        if ( $theme->exists() ) {
     3500                $status['oldVersion'] = $theme->get('Version');
     3501        }
     3502
    34963503        include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
    34973504
    34983505        $current = get_site_transient( 'update_themes' );