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:
parent
ec6de050b7
commit
64f2a546f0
@ -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 ] );
|
||||||
|
Loading…
Reference in New Issue
Block a user