Returns the given theme global styles variations.
Parameters
$request
WP_REST_Requestrequired- The request instance.
Source
public function get_theme_items( $request ) {
if ( get_stylesheet() !== $request['stylesheet'] ) {
// This endpoint only supports the active theme for now.
return new WP_Error(
'rest_theme_not_found',
__( 'Theme not found.' ),
array( 'status' => 404 )
);
}
$variations = WP_Theme_JSON_Resolver::get_style_variations();
return rest_ensure_response( $variations );
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.