Settings: Replace `count()` call with `empty()` in `get_settings_errors()` to prevent PHP 7.2 warnings when `$wp_settings_errors` is `null`.

Props pross, dd32, westonruter.
See #40109.
Fixes #42498 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42146


git-svn-id: http://core.svn.wordpress.org/trunk@41977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-11-10 22:30:56 +00:00
parent 9db496159e
commit 10ac2ccd3a
2 changed files with 3 additions and 2 deletions

View File

@ -1457,8 +1457,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
} }
// Check global in case errors have been added on this pageload. // Check global in case errors have been added on this pageload.
if ( ! count( $wp_settings_errors ) ) if ( empty( $wp_settings_errors ) ) {
return array(); return array();
}
// Filter the results to those of a specific setting if one was set. // Filter the results to those of a specific setting if one was set.
if ( $setting ) { if ( $setting ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-42144'; $wp_version = '5.0-alpha-42146';
/** /**
* 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.