From a3c2702e3a81adcc69a8b686fae63db94dc36b52 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 27 May 2009 19:05:58 +0000 Subject: [PATCH] Add confirmation AYS when upgrading a theme. fixes #9904 git-svn-id: http://svn.automattic.com/wordpress/trunk@11470 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/themes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 213c11f666..e8feeaccca 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -109,13 +109,14 @@ function theme_update_available( $theme ) { $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : ''); $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. $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); + $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;"'; if ( ! current_user_can('update_themes') ) printf( __('

There is a new version of %1$s available. View version %3$s Details.

'), $theme_name, $details_url, $update['new_version']); else if ( empty($update->package) ) printf( __('

There is a new version of %1$s available. View version %3$s Details automatic upgrade unavailable for this theme.

'), $theme_name, $details_url, $update['new_version']); else - printf( __('

There is a new version of %1$s available. View version %3$s Details or upgrade automatically.

'), $theme_name, $details_url, $update['new_version'], $update_url ); + printf( __('

There is a new version of %1$s available. View version %3$s Details or upgrade automatically.

'), $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); } }