From ad3c5a4946cc39fa68350f0e15306da737dd38b0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 9 Jul 2024 13:53:16 +0000 Subject: [PATCH] REST API: Remove a few unused variables in `foreach` loops. Follow-up to [38832], [48173], [49132], [49925]. Props antonvlasenko. See #61593. Built from https://develop.svn.wordpress.org/trunk@58694 git-svn-id: http://core.svn.wordpress.org/trunk@58096 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-attachments-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-block-types-controller.php | 2 +- .../endpoints/class-wp-rest-post-statuses-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-themes-controller.php | 2 +- .../search/class-wp-rest-post-format-search-handler.php | 2 +- wp-includes/version.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index cbc62b49ea..e2bc034147 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -1207,7 +1207,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { continue; } - list( $type, $attr_parts ) = explode( ';', $value, 2 ); + list( , $attr_parts ) = explode( ';', $value, 2 ); $attr_parts = explode( ';', $attr_parts ); $attributes = array(); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php index 38ac0e1881..263f2a8ef2 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php @@ -141,7 +141,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller { $namespace = $request['namespace']; } - foreach ( $block_types as $slug => $obj ) { + foreach ( $block_types as $obj ) { if ( $namespace ) { list ( $block_namespace ) = explode( '/', $obj->name ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php index 572950c24c..fab2307a2e 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php @@ -113,7 +113,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { $statuses = get_post_stati( array( 'internal' => false ), 'object' ); $statuses['trash'] = get_post_status_object( 'trash' ); - foreach ( $statuses as $slug => $obj ) { + foreach ( $statuses as $obj ) { $ret = $this->check_read_permission( $obj ); if ( ! $ret ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php index fe58480fb5..be12707b3c 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php @@ -201,7 +201,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller { $current_theme = wp_get_theme(); $status = $request['status']; - foreach ( $active_themes as $theme_name => $theme ) { + foreach ( $active_themes as $theme ) { $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive'; if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) { continue; diff --git a/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php b/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php index 8d815b1491..825a87a917 100644 --- a/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php +++ b/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php @@ -61,7 +61,7 @@ class WP_REST_Post_Format_Search_Handler extends WP_REST_Search_Handler { $query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request ); $found_ids = array(); - foreach ( $format_slugs as $index => $format_slug ) { + foreach ( $format_slugs as $format_slug ) { if ( ! empty( $query_args['search'] ) ) { $format_string = get_post_format_string( $format_slug ); $format_slug_match = stripos( $format_slug, $query_args['search'] ) !== false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 0a0c6d6a2f..384897b2ef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58693'; +$wp_version = '6.7-alpha-58694'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.