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.

Built from https://develop.svn.wordpress.org/trunk@36344


git-svn-id: http://core.svn.wordpress.org/trunk@36311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Eric Lewis 2016-01-18 19:57:26 +00:00
parent f956379447
commit 3f643ba9af
2 changed files with 2 additions and 2 deletions

View File

@ -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() );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-1453134913268';
$wp_version = '4.5-alpha-1453147032750';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.