Changeset 21195
- Timestamp:
- 06/30/2012 12:08:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r21131 r21195 852 852 $this->update_current++; 853 853 854 $this->skin->theme_info = $this->theme_info($theme); 855 854 856 if ( !isset( $current->response[ $theme ] ) ) { 855 857 $this->skin->set_result(false); … … 860 862 continue; 861 863 } 862 863 $this->skin->theme_info = $this->theme_info($theme);864 864 865 865 // Get the URL to the zip file … … 1352 1352 'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>' 1353 1353 ); 1354 if ( ! current_user_can( 'activate_plugins' ) ) 1355 unset( $update_actions['plugins_page'] ); 1354 1356 1355 1357 $update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info); … … 1385 1387 'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>' 1386 1388 ); 1389 if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) 1390 unset( $update_actions['themes_page'] ); 1387 1391 1388 1392 $update_actions = apply_filters('update_bulk_theme_complete_actions', $update_actions, $this->theme_info ); … … 1518 1522 if ( $this->type == 'web' ) 1519 1523 $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>'; 1520 else 1524 elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) 1521 1525 $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>'; 1522 1526 1523 if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )1527 if ( ! $this->result || is_wp_error($this->result) || is_network_admin() || ! current_user_can( 'switch_themes' ) ) 1524 1528 unset( $install_actions['activate'], $install_actions['preview'] ); 1525 1529 … … 1573 1577 1574 1578 if ( get_stylesheet() == $stylesheet ) { 1575 $update_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize" title="' . esc_attr( sprintf( __('Customize “%s”'), $name ) ) . '">' . __('Customize') . '</a>'; 1576 } else { 1579 if ( current_user_can( 'edit_theme_options' ) ) 1580 $update_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize" title="' . esc_attr( sprintf( __('Customize “%s”'), $name ) ) . '">' . __('Customize') . '</a>'; 1581 } elseif ( current_user_can( 'switch_themes' ) ) { 1577 1582 $update_actions['preview'] = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr( sprintf( __('Preview “%s”'), $name ) ) . '">' . __('Preview') . '</a>'; 1578 1583 $update_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize" title="' . esc_attr( sprintf( __('Preview “%s”'), $name ) ) . '">' . __('Live Preview') . '</a>';
Note: See TracChangeset
for help on using the changeset viewer.