From 93a75784b787a0f2aae2515c7777f322a6724f9b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 12 Jan 2024 19:14:08 +0000 Subject: [PATCH] Twenty Twenty: 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], [57275]. Props poena. See #60241. Built from https://develop.svn.wordpress.org/trunk@57276 git-svn-id: http://core.svn.wordpress.org/trunk@56782 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwenty/comments.php | 2 +- wp-content/themes/twentytwenty/functions.php | 2 +- wp-content/themes/twentytwenty/template-parts/pagination.php | 4 ++-- wp-includes/version.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentytwenty/comments.php b/wp-content/themes/twentytwenty/comments.php index c4ef803cba..91a3198eed 100644 --- a/wp-content/themes/twentytwenty/comments.php +++ b/wp-content/themes/twentytwenty/comments.php @@ -80,7 +80,7 @@ if ( $comments ) { $pagination_classes = ''; // If we're only showing the "Next" link, add a class indicating so. - if ( ! str_contains( $comment_pagination, 'prev page-numbers' ) ) { + if ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) { $pagination_classes = ' only-next'; } ?> diff --git a/wp-content/themes/twentytwenty/functions.php b/wp-content/themes/twentytwenty/functions.php index 55cb7988c1..3f1a556d1d 100644 --- a/wp-content/themes/twentytwenty/functions.php +++ b/wp-content/themes/twentytwenty/functions.php @@ -323,7 +323,7 @@ function twentytwenty_get_custom_logo( $html ) { ); // Add a style attribute with the height, or append the height to the style attribute if the style attribute already exists. - if ( ! str_contains( $html, ' style=' ) ) { + if ( false === strpos( $html, ' style=' ) ) { $search[] = '/(src=)/'; $replace[] = "style=\"height: {$logo_height}px;\" src="; } else { diff --git a/wp-content/themes/twentytwenty/template-parts/pagination.php b/wp-content/themes/twentytwenty/template-parts/pagination.php index 036b6fd6f4..b5236ccb6c 100644 --- a/wp-content/themes/twentytwenty/template-parts/pagination.php +++ b/wp-content/themes/twentytwenty/template-parts/pagination.php @@ -37,12 +37,12 @@ $posts_pagination = get_the_posts_pagination( ); // If we're not outputting the previous page link, prepend a placeholder with `visibility: hidden` to take its place. -if ( ! str_contains( $posts_pagination, 'prev page-numbers' ) ) { +if ( false === strpos( $posts_pagination, 'prev page-numbers' ) ) { $posts_pagination = str_replace( '', $posts_pagination ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f09f068c9b..2e0bd1d9ed 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57275'; +$wp_version = '6.5-alpha-57276'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.