LLMS_REST_Enrollments_Controller::get_item_schema()
Get the Enrollments’s schema, conforming to JSON Schema.
Return Return
(array)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-enrollments-controller.php
public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'students-enrollments', 'type' => 'object', 'properties' => array( 'post_id' => array( 'description' => __( 'The ID of the course/membership.', 'lifterlms' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'student_id' => array( 'description' => __( 'The ID of the student.', 'lifterlms' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'date_created' => array( 'description' => __( 'Creation date. Format: `Y-m-d H:i:s`', 'lifterlms' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), 'date_updated' => array( 'description' => __( 'Date last modified. Format: `Y-m-d H:i:s`', 'lifterlms' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'status' => array( 'description' => __( 'The status of the enrollment.', 'lifterlms' ), 'enum' => array_keys( llms_get_enrollment_statuses() ), 'context' => array( 'view', 'edit' ), 'type' => 'string', ), 'trigger' => array( 'description' => __( 'The enrollment trigger. Default is `any`.', 'lifterlms' ), 'context' => array( 'view', 'edit' ), 'type' => 'string', 'default' => 'any', 'readonly' => true, ), ), ); /** * Filter item schema for the enrollments controller. * * @since 1.0.0-beta.10 * * @param array $schema Item schema data. */ return apply_filters( 'llms_rest_enrollments_item_schema', $schema ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.10 | Added the trigger property. Added backticks in properties description where convenient. Added llms_rest_enrollments_item_schema filter hook. |
1.0.0-beta.1 | Introduced. |