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
1 changed files with 5 additions and 0 deletions

View File

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