Coding Standards: Use Yoda condition in str_ends_with().

This resolves a WPCS error:
{{{
Use Yoda Condition checks, you must.
}}}

Follow-up to [56015], [56016].

See #58220.

git-svn-id: https://develop.svn.wordpress.org/trunk@56017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2023-06-24 13:52:11 +00:00
parent 0fd9ee91ec
commit ffc386bfbd

View File

@ -488,7 +488,7 @@ if ( ! function_exists( 'str_ends_with' ) ) {
$len = strlen( $needle );
return $needle === substr( $haystack, -$len, $len );
return substr( $haystack, -$len, $len ) === $needle;
}
}