Ticket #13774: 13774.diff
File 13774.diff, 3.4 KB (added by , 13 years ago) |
---|
-
includes/class-wp-upgrader.php
1313 1313 parent::__construct($args); 1314 1314 } 1315 1315 1316 function header() { 1317 if ( $this->done_header ) 1318 return; 1319 $this->done_header = true; 1320 echo '<div class="wrap">'; 1321 if ( !isset( $this->api->template ) ) echo screen_icon(); 1322 echo '<h2>' . $this->options['title'] . '</h2>'; 1323 } 1324 1316 1325 function before() { 1317 1326 if ( !empty($this->api) ) { 1318 1327 /* translators: 1: theme name, 2: version */ … … 1337 1346 $install_actions = array( 1338 1347 'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>', 1339 1348 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>' 1340 1341 1349 ); 1350 1342 1351 if ( $this->type == 'web' ) 1343 1352 $install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>'; 1344 1353 else … … 1346 1355 1347 1356 if ( ! $this->result || is_wp_error($this->result) || is_network_admin() ) 1348 1357 unset( $install_actions['activate'], $install_actions['preview'] ); 1358 1359 if ( isset($this->api->child) ) 1360 unset( $install_actions['activate'], $install_actions['preview'], $install_actions['themes_page'] ); 1349 1361 1350 1362 $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info); 1351 1363 if ( ! empty($install_actions) ) -
update.php
208 208 $submenu_file = 'themes.php'; 209 209 require_once(ABSPATH . 'wp-admin/admin-header.php'); 210 210 211 if (isset($api->template) && !empty($api->template)) { 212 213 // look for the parent theme in the existing themes 214 $found = false; 215 $themes = get_themes(); 216 if ( ! $themes[$api->template] ) { 217 foreach ( $themes as $this_theme ) { 218 if ( is_array($this_theme) && $this_theme['Stylesheet'] == $api->template ) { 219 $found = true; 220 break; 221 } 222 } 223 } 224 225 // if we didn't find it, install it first 226 if (!$found) { 227 $child_api = $api; 228 $api = themes_api('theme_information', array('slug' => $api->template, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. 229 $api->child = $theme; // set the flag showing the installer that this is a parent theme install 230 231 $title = sprintf( __('Installing Parent Theme: %s'), $api->name . ' ' . $api->version ); 232 $nonce = 'install-theme_' . $api->template; 233 $url = 'update.php?action=install-theme&theme=' . $api->template; 234 $type = 'web'; //Install theme type, From Web or an Upload. 235 236 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); 237 $upgrader->install($api->download_link); 238 239 $api=$child_api; 240 } 241 } 242 211 243 $title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version ); 212 244 $nonce = 'install-theme_' . $theme; 213 245 $url = 'update.php?action=install-theme&theme=' . $theme;