wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php:197Retrieves a collection of themes.
$requestWP_REST_RequestWP_REST_Response|WP_Error public function get_items( $request ) { $themes = array(); $current_theme = wp_get_theme(); $status = $request['status']; if ( array( 'active' ) === $status ) { $prepared = $this->prepare_item_for_response( $current_theme, $request ); $themes[] = $this->prepare_response_for_collection( $prepared ); } else { foreach ( wp_get_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; } $prepared = $this->prepare_item_for_response( $theme, $request ); $themes[] = $this->prepare_response_for_collection( $prepared ); } } $response = rest_ensure_response( $themes ); $response->header( 'X-WP-Total', count( $themes ) ); $response->header( 'X-WP-TotalPages', 1 ); return $response; }Introduced in 5.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.