- Timestamp:
- 03/06/2026 06:02:38 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
r61429 r61856 198 198 $themes = array(); 199 199 200 $active_themes = wp_get_themes();201 200 $current_theme = wp_get_theme(); 202 201 $status = $request['status']; 203 202 204 foreach ( $active_themes as $theme ) { 205 $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive'; 206 if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) { 207 continue; 208 } 209 210 $prepared = $this->prepare_item_for_response( $theme, $request ); 203 if ( array( 'active' ) === $status ) { 204 $prepared = $this->prepare_item_for_response( $current_theme, $request ); 211 205 $themes[] = $this->prepare_response_for_collection( $prepared ); 206 } else { 207 foreach ( wp_get_themes() as $theme ) { 208 $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive'; 209 if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) { 210 continue; 211 } 212 213 $prepared = $this->prepare_item_for_response( $theme, $request ); 214 $themes[] = $this->prepare_response_for_collection( $prepared ); 215 } 212 216 } 213 217
Note: See TracChangeset
for help on using the changeset viewer.