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
This commit is contained in:
Eric Andrew Lewis 2016-01-18 19:56:54 +00:00
parent 7c6d2b0d61
commit 43da0d3894

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