Make WordPress Core

Changeset 61781

Timestamp:
03/02/2026 09:10:18 AM (3 days ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use str_starts_with() in WP_Duotone class methods.

This aims to make the code more readable and consistent, as the function is already used extensively in core files.

WordPress core includes a polyfill for str_starts_with() on PHP < 8.0 as of WordPress 5.9.

Follow-up to [55703], [58313].

Props Soean, mukesh27.
Fixes #64773.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-duotone.php

    r61603 r61781  
    11941194        $inner_classnames = explode( ' ', $tags->get_attribute( 'class' ) );
    11951195        foreach ( $inner_classnames as $classname ) {
    1196             if ( 0 === strpos( $classname, 'wp-duotone' ) ) {
     1196            if ( ( $classname, 'wp-duotone' ) ) {
    11971197                $tags->remove_class( $classname );
    11981198                $tags->seek( 'wrapper-div' );
Note: See TracChangeset for help on using the changeset viewer.