@@ -71,6 +71,10 @@ discard block |
||
| 71 | 71 | * @see WPCOM/wp-content/mu-plugins/string-helpers.php |
| 72 | 72 | */ |
| 73 | 73 | if ( ! function_exists( 'wp_startswith' ) ) : |
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * @param string $needle |
|
| 77 | + */ |
|
| 74 | 78 | function wp_startswith( $haystack, $needle ) { |
| 75 | 79 | return 0 === strpos( $haystack, $needle ); |
| 76 | 80 | } |
@@ -78,6 +82,10 @@ discard block |
||
| 78 | 82 | |
| 79 | 83 | |
| 80 | 84 | if ( ! function_exists( 'wp_endswith' ) ) : |
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * @param string $needle |
|
| 88 | + */ |
|
| 81 | 89 | function wp_endswith( $haystack, $needle ) { |
| 82 | 90 | return $needle === substr( $haystack, -strlen( $needle )); |
| 83 | 91 | } |