WP_REST_Posts_Controller::handle_template

SummerySummery

Sets the template for a post.

Syntax

WP_REST_Posts_Controller::handle_template( string $template, integer $post_id, bool $validate = false )

ParametersParameters

$template

(string) (Required) Page template filename.

$post_id

(integer) (Required) Post ID.

$validate

(bool) (Optional) Whether to validate that the template selected is valid.

Default value: false

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.9.0 Added the $validate parameter.
4.7.0 Introduced.
Scroll to Top