LLMS_REST_Enrollments_Controller::get_endpoint_args_for_item_schema( string $method = WP_REST_Server::CREATABLE )
Retrieves an array of endpoint arguments from the item schema for the controller.
Parameters Parameters
- $method
-
(string) (Optional) HTTP method of the request. The arguments for
CREATABLErequests are checked for required values and may fall-back to a given default, this is not done onEDITABLErequests.Default value: WP_REST_Server::CREATABLE
Return Return
(array) Endpoint arguments.
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-enrollments-controller.php
public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
if ( in_array( $method, array( 'PATCH', 'POST', WP_REST_Server::DELETABLE ), true ) ) {
$args = array(
'trigger' => array(
'description' => __( 'The trigger of the enrollment to act on.', 'lifterlms' ),
'type' => 'string',
'default' => 'any',
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',
),
);
} else {
$args = parent::get_endpoint_args_for_item_schema( $method );
}
return $args;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0-beta.10 | Introduced. |