Skip to content

Commit c59b7b1

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@57276 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f036880 commit c59b7b1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/wp-content/themes/twentytwenty/comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
$pagination_classes = '';
8181

8282
// If we're only showing the "Next" link, add a class indicating so.
83-
if ( ! str_contains( $comment_pagination, 'prev page-numbers' ) ) {
83+
if ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) {
8484
$pagination_classes = ' only-next';
8585
}
8686
?>

src/wp-content/themes/twentytwenty/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function twentytwenty_get_custom_logo( $html ) {
323323
);
324324

325325
// Add a style attribute with the height, or append the height to the style attribute if the style attribute already exists.
326-
if ( ! str_contains( $html, ' style=' ) ) {
326+
if ( false === strpos( $html, ' style=' ) ) {
327327
$search[] = '/(src=)/';
328328
$replace[] = "style=\"height: {$logo_height}px;\" src=";
329329
} else {

src/wp-content/themes/twentytwenty/template-parts/pagination.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
);
3838

3939
// If we're not outputting the previous page link, prepend a placeholder with `visibility: hidden` to take its place.
40-
if ( ! str_contains( $posts_pagination, 'prev page-numbers' ) ) {
40+
if ( false === strpos( $posts_pagination, 'prev page-numbers' ) ) {
4141
$posts_pagination = str_replace( '<div class="nav-links">', '<div class="nav-links"><span class="prev page-numbers placeholder" aria-hidden="true">' . $prev_text . '</span>', $posts_pagination );
4242
}
4343

4444
// If we're not outputting the next page link, append a placeholder with `visibility: hidden` to take its place.
45-
if ( ! str_contains( $posts_pagination, 'next page-numbers' ) ) {
45+
if ( false === strpos( $posts_pagination, 'next page-numbers' ) ) {
4646
$posts_pagination = str_replace( '</div>', '<span class="next page-numbers placeholder" aria-hidden="true">' . $next_text . '</span></div>', $posts_pagination );
4747
}
4848

0 commit comments

Comments
 (0)