diff --git a/src/wp-includes/compat.php b/src/wp-includes/compat.php index f9df28eac9..38ae725e93 100644 --- a/src/wp-includes/compat.php +++ b/src/wp-includes/compat.php @@ -488,7 +488,7 @@ if ( ! function_exists( 'str_ends_with' ) ) { $len = strlen( $needle ); - return 0 === substr_compare( $haystack, $needle, -$len, $len ); + return $needle === substr( $haystack, -$len, $len ); } }