mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
6d7e0b6a60
commit
ad3c5a4946
@ -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();
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 ) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user