mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user