From 13ba79ef36331bf072d5415b9f77885f4889e054 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 29 Nov 2013 08:37:17 +0000 Subject: [PATCH] Themes: When the user doesn't have switch_themes capabilities, and we've passed the current theme, detect the theme slug/stylesheet correctly so that the flags are set properly. See #25948 git-svn-id: https://develop.svn.wordpress.org/trunk@26469 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index ad3781a9dc..898b1cd016 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -392,12 +392,13 @@ function wp_prepare_themes_for_js( $themes = null ) { } WP_Theme::sort_by_name( $themes ); - foreach ( $themes as $slug => $theme ) { + foreach ( $themes as $theme ) { $parent = false; if ( $theme->parent() ) { $parent = $theme->parent()->display( 'Name' ); } + $slug = $theme->get_stylesheet(); $encoded_slug = urlencode( $slug ); $prepared_themes[] = array(