Make WordPress Core

Changeset 58889


Ignore:
Timestamp:
08/13/2024 04:27:32 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Replace an empty foreach loop in wp_replace_in_html_tags().

This aims to clarify the intention of the code and improve readability.

Follow-up to [33359].

Props jrf, TobiasBg, mi5t4n, dhruvang21, mayura8991, nadimcse, Presskopp, SergeyBiryukov.
Fixes #61860.

File:
1 edited

Legend:

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

    r58814 r58889  
    763763    if ( 1 === count( $replace_pairs ) ) {
    764764        // Extract $needle and $replace.
    765         foreach ( $replace_pairs as $needle => $replace ) {
    766         }
     765        $needle  = array_key_first( $replace_pairs );
     766        $replace = $replace_pairs[ $needle ];
    767767
    768768        // Loop through delimiters (elements) only.
Note: See TracChangeset for help on using the changeset viewer.