Skip to content

Commit

Permalink
Coding Standards: Replace an empty foreach loop in `wp_replace_in_h…
Browse files Browse the repository at this point in the history
…tml_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.
Built from https://develop.svn.wordpress.org/trunk@58889


git-svn-id: https://core.svn.wordpress.org/trunk@58285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Aug 13, 2024
1 parent 95344c5 commit 1fd8f95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
// Optimize when searching for one item.
if ( 1 === count( $replace_pairs ) ) {
// Extract $needle and $replace.
foreach ( $replace_pairs as $needle => $replace ) {
}
$needle = array_key_first( $replace_pairs );
$replace = $replace_pairs[ $needle ];

// Loop through delimiters (elements) only.
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-alpha-58888';
$wp_version = '6.7-alpha-58889';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 1fd8f95

Please sign in to comment.