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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42146 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-11-10 22:29:45 +00:00
parent 89bea84d6e
commit 08a3691775
2 changed files with 44 additions and 1 deletions
+2 -1
View File
@@ -1457,8 +1457,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
}
// Check global in case errors have been added on this pageload.
if ( ! count( $wp_settings_errors ) )
if ( empty( $wp_settings_errors ) ) {
return array();
}
// Filter the results to those of a specific setting if one was set.
if ( $setting ) {