Skip to content

Commit

Permalink
REST API: Remove a few unused variables in foreach loops.
Browse files Browse the repository at this point in the history
Follow-up to [38832], [48173], [49132], [49925].

Props antonvlasenko.
See #61593.

git-svn-id: https://develop.svn.wordpress.org/trunk@58694 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 9, 2024
1 parent 3b90d94 commit 80112f2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ public static function get_filename_from_disposition( $disposition_header ) {
continue;
}

list( $type, $attr_parts ) = explode( ';', $value, 2 );
list( , $attr_parts ) = explode( ';', $value, 2 );

$attr_parts = explode( ';', $attr_parts );
$attributes = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function get_items( $request ) {
$namespace = $request['namespace'];
}

foreach ( $block_types as $slug => $obj ) {
foreach ( $block_types as $obj ) {
if ( $namespace ) {
list ( $block_namespace ) = explode( '/', $obj->name );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function get_items( $request ) {
$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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function get_items( $request ) {
$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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function search_items( WP_REST_Request $request ) {
$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;
Expand Down

0 comments on commit 80112f2

Please sign in to comment.