W3cubDocs

/WordPress

WP_REST_Autosaves_Controller::get_parent( int $parent_id )

Get the parent post.

Parameters

$parent_id

(int) (Required) Supplied ID.

Return

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

Source

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

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

Changelog

Version Description
5.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_autosaves_controller/get_parent