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
This commit is contained in:
Sergey Biryukov 2024-07-09 13:53:16 +00:00
parent 6d7e0b6a60
commit ad3c5a4946
6 changed files with 6 additions and 6 deletions

View File

@ -1207,7 +1207,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
continue; continue;
} }
list( $type, $attr_parts ) = explode( ';', $value, 2 ); list( , $attr_parts ) = explode( ';', $value, 2 );
$attr_parts = explode( ';', $attr_parts ); $attr_parts = explode( ';', $attr_parts );
$attributes = array(); $attributes = array();

View File

@ -141,7 +141,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
$namespace = $request['namespace']; $namespace = $request['namespace'];
} }
foreach ( $block_types as $slug => $obj ) { foreach ( $block_types as $obj ) {
if ( $namespace ) { if ( $namespace ) {
list ( $block_namespace ) = explode( '/', $obj->name ); list ( $block_namespace ) = explode( '/', $obj->name );

View File

@ -113,7 +113,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
$statuses = get_post_stati( array( 'internal' => false ), 'object' ); $statuses = get_post_stati( array( 'internal' => false ), 'object' );
$statuses['trash'] = get_post_status_object( 'trash' ); $statuses['trash'] = get_post_status_object( 'trash' );
foreach ( $statuses as $slug => $obj ) { foreach ( $statuses as $obj ) {
$ret = $this->check_read_permission( $obj ); $ret = $this->check_read_permission( $obj );
if ( ! $ret ) { if ( ! $ret ) {

View File

@ -201,7 +201,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller {
$current_theme = wp_get_theme(); $current_theme = wp_get_theme();
$status = $request['status']; $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'; $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive';
if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) { if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) {
continue; continue;

View File

@ -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 ); $query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request );
$found_ids = array(); $found_ids = array();
foreach ( $format_slugs as $index => $format_slug ) { foreach ( $format_slugs as $format_slug ) {
if ( ! empty( $query_args['search'] ) ) { if ( ! empty( $query_args['search'] ) ) {
$format_string = get_post_format_string( $format_slug ); $format_string = get_post_format_string( $format_slug );
$format_slug_match = stripos( $format_slug, $query_args['search'] ) !== false; $format_slug_match = stripos( $format_slug, $query_args['search'] ) !== false;

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.