X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/bf5c68485ef07868ad0a91168ecd0092af7661ae..refs/tags/wordpress-3.4:/wp-admin/network/themes.php
diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php
index 611c0957..ba56a4a4 100644
--- a/wp-admin/network/themes.php
+++ b/wp-admin/network/themes.php
@@ -40,7 +40,10 @@ if ( $action ) {
check_admin_referer('enable-theme_' . $_GET['theme']);
$allowed_themes[ $_GET['theme'] ] = true;
update_site_option( 'allowedthemes', $allowed_themes );
- wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
+ if ( false === strpos( $referer, '/network/themes.php' ) )
+ wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
+ else
+ wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
exit;
break;
case 'disable':
@@ -95,7 +98,6 @@ if ( $action ) {
screen_icon();
echo '
' . esc_html( $title ) . '
';
-
$url = self_admin_url('update.php?action=update-selected-themes&themes=' . urlencode( join(',', $themes) ));
$url = wp_nonce_url($url, 'bulk-update-themes');
@@ -111,26 +113,17 @@ if ( $action ) {
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
- if ( isset( $themes[ get_option( 'template' ) ] ) )
- unset( $themes[ get_option( 'template' ) ] );
- if ( isset( $themes[ get_option( 'stylesheet' ) ] ) )
- unset( $themes[ get_option( 'stylesheet' ) ] );
+ unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] );
if ( empty( $themes ) ) {
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
exit;
}
- $main_theme = get_current_theme();
$files_to_delete = $theme_info = array();
foreach ( $themes as $key => $theme ) {
- $data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' );
- if ( $data['Name'] == $main_theme ) {
- unset( $themes[$key] );
- } else {
- $files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
- $theme_info[ $theme ] = $data;
- }
+ $theme_info[ $theme ] = wp_get_theme( $theme );
+ $files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) );
}
if ( empty( $themes ) ) {
@@ -156,7 +149,7 @@ if ( $action ) {
', sprintf( __('%1$s by %2$s' ), esc_html( $theme['Name'] ), esc_html( $theme['AuthorName'] ) ), ''; /* translators: 1: theme name, 2: theme author */ ?>
+ echo '- ', sprintf( __('%1$s by %2$s' ), $theme->display('Name'), $theme->display('Author') ), '
'; /* translators: 1: theme name, 2: theme author */ ?>
-views(); ?>
+views();
+
+if ( 'broken' == $status )
+ echo '' . __('The following themes are installed but incomplete. Themes must have a stylesheet and a template.') . '
';
+?>