WordPress.org

Make WordPress Core

Changeset 11470


Ignore:
Timestamp:
05/27/09 19:05:58 (5 years ago)
Author:
ryan
Message:

Add confirmation AYS when upgrading a theme. fixes #9904

File:
1 edited

Legend:

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

    r11445 r11470  
    110110        $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. 
    111111        $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); 
     112        $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Upgrading this theme will lose any customizations you have made.  'Cancel' to stop, 'OK' to upgrade.") ) . '\') ) {return true;}return false;"'; 
    112113 
    113114        if ( ! current_user_can('update_themes') ) 
     
    116117            printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> <em>automatic upgrade unavailable for this theme</em>.</p>'), $theme_name, $details_url, $update['new_version']); 
    117118        else 
    118             printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s">upgrade automatically</a>.</p>'), $theme_name, $details_url, $update['new_version'], $update_url ); 
     119            printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s" %5$s >upgrade automatically</a>.</p>'), $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); 
    119120    } 
    120121} 
Note: See TracChangeset for help on using the changeset viewer.