From 10ac2ccd3afea49140bb61fbf3d8cf0e81399aff Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 10 Nov 2017 22:30:56 +0000 Subject: [PATCH] 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 --- wp-admin/includes/template.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index ec0fb52591..0c8c863ec7 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -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 ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 7e49726e14..1789e84116 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.