Make WordPress Core

Changeset 58694


Ignore:
Timestamp:
07/09/2024 01:51:12 PM (2 years ago)
Author:
SergeyBiryukov
Message:

REST API: Remove a few unused variables in foreach loops.

Follow-up to [38832], [48173], [49132], [49925].

Props antonvlasenko.
See #61593.

Location:
trunk/src/wp-includes/rest-api
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r58612 r58694  
    12081208                        }
    12091209
    1210                         list( $type, $attr_parts ) = explode( ';', $value, 2 );
     1210                        list( , $attr_parts ) = explode( ';', $value, 2 );
    12111211
    12121212                        $attr_parts = explode( ';', $attr_parts );
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php

    r57771 r58694  
    142142                }
    143143
    144                 foreach ( $block_types as $slug => $obj ) {
     144                foreach ( $block_types as $obj ) {
    145145                        if ( $namespace ) {
    146146                                list ( $block_namespace ) = explode( '/', $obj->name );
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php

    r56586 r58694  
    114114                $statuses['trash'] = get_post_status_object( 'trash' );
    115115
    116                 foreach ( $statuses as $slug => $obj ) {
     116                foreach ( $statuses as $obj ) {
    117117                        $ret = $this->check_read_permission( $obj );
    118118
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

    r58408 r58694  
    202202                $status        = $request['status'];
    203203
    204                 foreach ( $active_themes as $theme_name => $theme ) {
     204                foreach ( $active_themes as $theme ) {
    205205                        $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive';
    206206                        if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) {
  • trunk/src/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php

    r57643 r58694  
    6262
    6363                $found_ids = array();
    64                 foreach ( $format_slugs as $index => $format_slug ) {
     64                foreach ( $format_slugs as $format_slug ) {
    6565                        if ( ! empty( $query_args['search'] ) ) {
    6666                                $format_string       = get_post_format_string( $format_slug );
Note: See TracChangeset for help on using the changeset viewer.