General: Introduce WP_Error::has_errors() method and use it where appropriate.

Props robdxw, DrewAPicture, SergeyBiryukov.
Fixes #42742.

git-svn-id: https://develop.svn.wordpress.org/trunk@42761 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2018-02-27 02:30:46 +00:00
parent 2f68ec5750
commit 1cc516f2e8
21 changed files with 71 additions and 40 deletions
@@ -161,7 +161,7 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
$validity->add( 'illegal_markup', __( 'Markup is not allowed in CSS.' ) );
}
if ( empty( $validity->errors ) ) {
if ( ! $validity->has_errors() ) {
$validity = parent::validate( $css );
}
return $validity;