From a2b95a643fb50d1e27c071ac924e343f4c38f27c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 30 Apr 2018 04:50:52 +0000 Subject: [PATCH] Themes: Avoid a PHP 7.2 warning in `get_theme_roots()` when `$wp_theme_directories` is an uncountable value. See [41174] for `wp_get_themes()` and `get_raw_theme_root()`. Props burlingtonbytes, teddytime, lbenicio, desrosj. Fixes #43374. See #40109. git-svn-id: https://develop.svn.wordpress.org/trunk@43039 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 2a2922950d..4e4edd838e 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -370,7 +370,7 @@ function get_template_directory_uri() { function get_theme_roots() { global $wp_theme_directories; - if ( count( $wp_theme_directories ) <= 1 ) { + if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { return '/themes'; }