diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 234d71a2a175a..ddb672145fe85 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -446,7 +446,7 @@ function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) { function wpautop( $text, $br = true ) { $pre_tags = array(); - if ( trim( $text ) === '' ) { + if ( '' === trim( $text ) ) { return ''; } @@ -1167,7 +1167,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters = $unicode .= $encoded_char; $unicode_length += $encoded_char_length; } else { - if ( count( $values ) === 0 ) { + if ( 0 === count( $values ) ) { if ( $value < 224 ) { $num_octets = 2; } elseif ( $value < 240 ) { @@ -2551,7 +2551,7 @@ function convert_invalid_entities( $content ) { * @return string Balanced text. */ function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid - if ( $force || (int) get_option( 'use_balanceTags' ) === 1 ) { + if ( $force || 1 === (int) get_option( 'use_balanceTags' ) ) { return force_balance_tags( $text ); } else { return $text; @@ -2992,7 +2992,7 @@ function _make_web_ftp_clickable_cb( $matches ) { // Removed trailing [.,;:)] from URL. $last_char = substr( $dest, -1 ); - if ( in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) === true ) { + if ( true === in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) ) { $ret = $last_char; $dest = substr( $dest, 0, strlen( $dest ) - 1 ); } @@ -3319,7 +3319,7 @@ function wp_targeted_link_rel( $text ) { _deprecated_function( __FUNCTION__, '6.7.0' ); // Don't run (more expensive) regex if no links with targets. - if ( stripos( $text, 'target' ) === false || stripos( $text, '