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.
Built from https://develop.svn.wordpress.org/trunk@43039


git-svn-id: http://core.svn.wordpress.org/trunk@42868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-04-30 04:51:22 +00:00
parent 94cbb2a3f6
commit 4b6794ba57
2 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ function get_template_directory_uri() {
function get_theme_roots() { function get_theme_roots() {
global $wp_theme_directories; global $wp_theme_directories;
if ( count( $wp_theme_directories ) <= 1 ) { if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
return '/themes'; return '/themes';
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-43036'; $wp_version = '5.0-alpha-43039';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.