From 43da0d3894267089bd4cfa58896b5619bbcfc097 Mon Sep 17 00:00:00 2001 From: Eric Andrew Lewis Date: Mon, 18 Jan 2016 19:56:54 +0000 Subject: [PATCH] Themes: Show template loading error to users with `switch_themes` cap. In [36338], a template loading error was shown only to users with the `install_themes` capability. This is now displayed users with the `switch_themes` capability, as users with this cap can at least switch to a different theme. Also, this will now show for site administrators in multisite, whereas `install_themes` is limited to superadmins. Props dd32. See #21931. git-svn-id: https://develop.svn.wordpress.org/trunk@36344 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/template-loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/template-loader.php b/src/wp-includes/template-loader.php index b466bc2cfe..45fd33e96b 100644 --- a/src/wp-includes/template-loader.php +++ b/src/wp-includes/template-loader.php @@ -86,7 +86,7 @@ if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : */ if ( $template = apply_filters( 'template_include', $template ) ) { include( $template ); - } elseif ( current_user_can( 'install_themes' ) ) { + } elseif ( current_user_can( 'switch_themes' ) ) { $theme = wp_get_theme(); if ( $theme->errors() ) { wp_die( $theme->errors() );