WP_REST_Global_Styles_Revisions_Controller::get_revision( int $id ): WP_Post|WP_Error

In this article

Gets the global styles revision, if the ID is valid.

Parameters

$idintrequired
Supplied ID.

Return

WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise.

Source

}

if ( rest_is_field_included( 'date', $fields ) ) {
	$data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date );
}

if ( rest_is_field_included( 'date_gmt', $fields ) ) {
	$data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt );
}

if ( rest_is_field_included( 'id', $fields ) ) {
	$data['id'] = (int) $post->ID;
}

if ( rest_is_field_included( 'modified', $fields ) ) {
	$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.