General: Fix nesting in compat.php.
Follow up to [57451]. Built from https://develop.svn.wordpress.org/branches/5.7@57456 git-svn-id: http://core.svn.wordpress.org/branches/5.7@56957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b584f790fc
commit
f51ef1dabe
|
@ -369,8 +369,9 @@ if ( ! function_exists( 'is_iterable' ) ) {
|
||||||
function is_iterable( $var ) {
|
function is_iterable( $var ) {
|
||||||
return ( is_array( $var ) || $var instanceof Traversable );
|
return ( is_array( $var ) || $var instanceof Traversable );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! function_exists( 'str_starts_with' ) ) {
|
if ( ! function_exists( 'str_starts_with' ) ) {
|
||||||
/**
|
/**
|
||||||
* Polyfill for `str_starts_with()` function added in PHP 8.0.
|
* Polyfill for `str_starts_with()` function added in PHP 8.0.
|
||||||
*
|
*
|
||||||
|
@ -390,9 +391,9 @@ if ( ! function_exists( 'is_iterable' ) ) {
|
||||||
|
|
||||||
return 0 === strpos( $haystack, $needle );
|
return 0 === strpos( $haystack, $needle );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! function_exists( 'str_ends_with' ) ) {
|
if ( ! function_exists( 'str_ends_with' ) ) {
|
||||||
/**
|
/**
|
||||||
* Polyfill for `str_ends_with()` function added in PHP 8.0.
|
* Polyfill for `str_ends_with()` function added in PHP 8.0.
|
||||||
*
|
*
|
||||||
|
@ -414,5 +415,4 @@ if ( ! function_exists( 'is_iterable' ) ) {
|
||||||
|
|
||||||
return substr( $haystack, -$len, $len ) === $needle;
|
return substr( $haystack, -$len, $len ) === $needle;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue