WP_REST_Posts_Controller::sanitize_post_statuses

SummerySummery

Sanitizes and validates the list of post statuses, including whether the user can query private statuses.

Syntax

WP_REST_Posts_Controller::sanitize_post_statuses( string|array $statuses, WP_REST_Request $request, string $parameter )

ParametersParameters

$statuses

(string|array) (Required) One or more post statuses.

$request

(WP_REST_Request) (Required) Full details about the request.

$parameter

(string) (Required) Additional parameter to pass to validation.

ReturnReturn

(array|WP_Error) A list of valid statuses, otherwise WP_Error object.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.7.0 Introduced.
Scroll to Top