LLMS_REST_Posts_Controller
Description Description
Source Source
File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-posts-controller.php
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.9 | Implemented a generic way to create and get an llms post object instance given a post_type . In get_objects_from_query() avoid performing an additional query, just return the already retrieved posts. Removed "llms_rest_{$this->post_type}_filters_removed_for_reponse" filter hooks, "llms_rest_{$this->post_type}_filters_removed_for_response" added. |
1.0.0-beta.8 | Return links to those taxonomies which have an accessible rest route. Initialize $prepared_item array before adding values to it. |
1.0.0-beta.7 | Added: check_read_object_permissions() , get_objects_from_query() , get_objects_query() , get_pagination_data_from_query() , prepare_collection_items_for_response() methods overrides. get_items() method removed, now abstracted in LLMS_REST_Controller. prepare_objects_query() renamed to prepare_collection_query_args() . On update_item , don't execute $object->set_bulk() when there's no data to update. Fix wp:featured_media link, we don't expose any embeddable field. Also self and collection links prepared in the parent class. Added "llms_rest_insert_{$this->post_type}" and "llms_rest_insert_{$this->post_type}" action hooks: fired after inserting/updateing an llms post into the database. |
1.0.0-beta.3 | Filter taxonomies by show_in_llms_rest property instead of public . |
1.0.0-beta.2 | Filter taxonomies by public property instead of show_in_rest . |
1.0.0-beta.14 | Update prepare_links() to accept a second parameter, WP_REST_Request . |
1.0.0-beta.12 | Moved parameters to query args mapping from $this->prepare_collection_params() to $this->map_params_to_query_args() . |
1.0.0-beta.11 | Fixed "llms_rest_insert_{$this->post_type}" and "llms_rest_insert_{$this->post_type}" action hooks fourth param: must be false when updating. |
1.0.0-beta.1 | Introduced. |
Methods Methods
- can_access_password_content — Checks if the user can access password-protected content.
- check_assign_terms_permission — Checks whether current user can assign all terms sent with the current request.
- check_create_permission — Checks if a post can be edited.
- check_delete_permission — Checks if an llms post can be deleted.
- check_read_object_permissions — Determine if the current user can view the object.
- check_read_permission — Checks if an llms post can be read.
- check_update_permission — Checks if an llms post can be edited.
- create_item — Creates a single LLMS post.
- create_item_permissions_check — Check if a given request has access to create an item.
- create_llms_post — Create an LLMS_Post_Model
- delete_item — Deletes a single llms post.
- delete_item_permissions_check — Check if a given request has access to delete an item.
- get_collection_params — Retrieves the query params for the objects collection
- get_delete_item_args — Retrieves an array of arguments for the delete endpoint.
- get_filters_to_be_removed_for_response — Get action/filters to be removed before preparing the item for response.
- get_get_item_params — Retrieves the query params for retrieving a single resource.
- get_item_permissions_check — Check if a given request has access to read an item.
- get_item_schema — Get the LLMS Posts's schema, conforming to JSON Schema.
- get_items_permissions_check — Check if a given request has access to read items.
- get_object — Get object.
- get_objects_from_query — Retrieve an array of objects from the result of `$this->get_objects_query()`.
- get_objects_query — Retrieve a query object based on arguments from a `get_items()` (collection) request.
- get_pagination_data_from_query — Retrieve pagination information from an objects query.
- get_taxonomy_rest_base — Maps a taxonomy name to the relative rest base
- handle_featured_media — Determines the featured media based on a request param
- handle_status_param — Determines validity and normalizes the given status parameter.
- handle_terms — Updates the post's terms from a REST request.
- is_delete_forced — Whether the delete should be forced.
- is_trash_supported — Whether the trash is supported.
- llms_post_class_from_post_type — Get the llms post model class from the controller post type.
- map_params_to_query_args — Map schema to query arguments to retrieve a collection of objects.
- maybe_add_removed_filters_for_response — Re-add filters previously removed
- maybe_remove_filters_for_response — Re-add filters previously removed
- prepare_collection_items_for_response — Prepare collection items for response.
- prepare_collection_query_args — Format query arguments to retrieve a collection of objects.
- prepare_item_for_database — Prepares a single post for create or update.
- prepare_item_for_response — Prepare a single item for the REST response
- prepare_items_query — Determines the allowed query_vars for a get_items() response and prepares them for WP_Query.
- prepare_items_query_orderby_mappings — Map to proper WP_Query orderby param.
- prepare_links — Prepare links for the request.
- prepare_object_for_response — Prepare a single object output for response.
- sanitize_post_statuses — Sanitizes and validates the list of post statuses, including whether the user can query private statuses
- update_additional_object_fields — Updates a single llms post.
- update_item — Updates a single llms post.
- update_item_permissions_check — Check if a given request has access to update an item.