From d00954f12e73b528d60eb401c4d59c48d7aa7cd3 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 30 May 2012 18:55:20 +0000 Subject: [PATCH] Post theme upgrade/install tweaks. * Add title attributes to Live Preview links. * Show Customize instead of Live Preview after upgrading current theme. * Hide activate and preview links after theme upgrade when in the network admin. Props SergeyBiryukov fixes #20784 git-svn-id: http://core.svn.wordpress.org/trunk@20958 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index cb66693d24..f1ca14135d 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1517,7 +1517,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin { $install_actions = array(); $install_actions['preview'] = '' . __('Preview') . ''; - $install_actions['preview'] .= '' . __('Live Preview') . ''; + $install_actions['preview'] .= '' . __('Live Preview') . ''; $install_actions['activate'] = '' . __('Activate') . ''; if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) @@ -1579,12 +1579,16 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { ), admin_url('themes.php') ); $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $template ); - $update_actions['preview'] = '' . __('Preview') . ''; - $update_actions['preview'] .= '' . __('Live Preview') . ''; - $update_actions['activate'] = '' . __('Activate') . ''; + if ( get_stylesheet() == $stylesheet ) { + $update_actions['preview'] = '' . __('Customize') . ''; + } else { + $update_actions['preview'] = '' . __('Preview') . ''; + $update_actions['preview'] .= '' . __('Live Preview') . ''; + $update_actions['activate'] = '' . __('Activate') . ''; + } - if ( ( ! $this->result || is_wp_error( $this->result ) ) || $stylesheet == get_stylesheet() ) - unset($update_actions['preview'], $update_actions['activate']); + if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() ) + unset( $update_actions['preview'], $update_actions['activate'] ); } $update_actions['themes_page'] = '' . __('Return to Themes page') . '';