WP_REST_Posts_Controller::get_post

SummerySummery

Get the post, if the ID is valid.

Syntax

WP_REST_Posts_Controller::get_post( int $id )

ParametersParameters

$id

(int) (Required) Supplied ID.

ReturnReturn

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

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.7.2 Introduced.
Scroll to Top