Make WordPress Core


Ignore:
Timestamp:
01/16/2024 04:07:50 PM (17 months ago)
Author:
desrosj
Message:

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].

Merges [57276] to the 6.4 branch.

Props poena, SergeyBiryukov.
See #60241.

Location:
branches/6.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.4

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

    r55988 r57292  
    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' ) ) {
     40if ( 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' ) ) {
     45if ( 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}
Note: See TracChangeset for help on using the changeset viewer.