Skip to content

Commit f036880

Browse files
Twenty Seventeen: Revert usage of str_contains() in theme files.
The theme supports WordPress 4.7 or later, while the polyfill for `str_contains()` only exists in WordPress 5.9 or later. Follow-up to [55988]. Props poena. See #60241. git-svn-id: https://develop.svn.wordpress.org/trunk@57275 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c363981 commit f036880

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-content/themes/twentyseventeen/inc/icon-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $ar
130130
// Change SVG icon inside social links menu if there is supported URL.
131131
if ( 'social' === $args->theme_location ) {
132132
foreach ( $social_icons as $attr => $value ) {
133-
if ( str_contains( $item_output, $attr ) ) {
133+
if ( false !== strpos( $item_output, $attr ) ) {
134134
$item_output = str_replace( $args->link_after, '</span>' . twentyseventeen_get_svg( array( 'icon' => esc_attr( $value ) ) ), $item_output );
135135
}
136136
}

src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
$audio = false;
4747

4848
// Only get audio from the content if a playlist isn't present.
49-
if ( ! str_contains( $content, 'wp-playlist-script' ) ) {
49+
if ( false === strpos( $content, 'wp-playlist-script' ) ) {
5050
$audio = get_media_embedded_in_content( $content, array( 'audio' ) );
5151
}
5252

src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
$video = false;
4747

4848
// Only get video from the content if a playlist isn't present.
49-
if ( ! str_contains( $content, 'wp-playlist-script' ) ) {
49+
if ( false === strpos( $content, 'wp-playlist-script' ) ) {
5050
$video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
5151
}
5252
?>

0 commit comments

Comments
 (0)