Themes: Avoid PHP warnings in the admin when no theme directory exists.

Props iseulde, chris_dev, swissspidy.
Fixes #35521.


git-svn-id: https://develop.svn.wordpress.org/trunk@40636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2017-05-11 19:20:10 +00:00
parent ec6de050b7
commit 64f2a546f0

View File

@ -28,6 +28,11 @@ if ( ! is_network_admin() ) {
} }
$installed_themes = search_theme_directories(); $installed_themes = search_theme_directories();
if ( false === $installed_themes ) {
$installed_themes = array();
}
foreach ( $installed_themes as $k => $v ) { foreach ( $installed_themes as $k => $v ) {
if ( false !== strpos( $k, '/' ) ) { if ( false !== strpos( $k, '/' ) ) {
unset( $installed_themes[ $k ] ); unset( $installed_themes[ $k ] );