LLMS_REST_Posts_Controller::handle_status_param( string $status )
Determines validity and normalizes the given status parameter.
Description Description
Heavily based on WP_REST_Posts_Controller::handle_status_param().
Parameters Parameters
- $status
-
(string) (Required) Status.
Return Return
(string|WP_Error) Status or WP_Error if lacking the proper permission.
Source Source
File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-posts-controller.php
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * @since 1.0.0-beta.9 * * @param array $filters Array of filters to be removed. * @param LLMS_Post_Model $object LLMS_Post_Model object. */ return apply_filters( "llms_rest_{$this->post_type}_filters_removed_for_response", array(), $object ); } /** * Determines validity and normalizes the given status parameter. * Heavily based on WP_REST_Posts_Controller::handle_status_param(). * * @since 1.0.0-beta.1 * @since 1.0.0-beta.18 Use plural post type name. * * @param string $status Status. * @return string|WP_Error Status or WP_Error if lacking the proper permission. */ protected function handle_status_param( $status ) { $post_type_object = get_post_type_object( $this->post_type ); $post_type_name = $post_type_object->labels->name; switch ( $status ) { case 'draft': case 'pending': break; case 'private':
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.18 | Use plural post type name. |
1.0.0-beta.1 | Introduced. |