WP_REST_Global_Styles_Controller::get_item() WordPress Method

The WP_REST_Global_Styles_Controller::get_item() method is used to retrieve a global style.

WP_REST_Global_Styles_Controller::get_item( WP_REST_Request $request ) #

Returns the given global styles config.


Parameters

$request

(WP_REST_Request)(Required)The request instance.


Top ↑

Return

(WP_REST_Response|WP_Error)


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php

	public function get_item( $request ) {
		$post = $this->get_post( $request['id'] );
		if ( is_wp_error( $post ) ) {
			return $post;
		}

		return $this->prepare_item_for_response( $post, $request );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.