WP_REST_Template_Autosaves_Controller::get_parent()protectedWP 6.4.0

Get the parent post.

Method of the class: WP_REST_Template_Autosaves_Controller{}

No Hooks.

Return

WP_Post|WP_Error. Post object if ID is valid, WP_Error otherwise.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_parent( $parent_id );
$parent_id(int) (required)
Supplied ID.

Changelog

Since 6.4.0 Introduced.

WP_REST_Template_Autosaves_Controller::get_parent() code WP 6.6.2

protected function get_parent( $parent_id ) {
	return $this->revisions_controller->get_parent( $parent_id );
}