LLMS_REST_Sections_Controller::register_routes()

Register routes.


Return Return

(void)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-sections-controller.php

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
* @since 1.0.0-beta.1
 *
 * @return void
 */
public function register_routes() {
 
    parent::register_routes();
 
    if ( isset( $this->content_controller ) ) {
        register_rest_route(
            $this->namespace,
            '/' . $this->rest_base . '/(?P<id>[\d]+)/content',
            array(
                'args'   => array(
                    'id' => array(
                        // translators: %1$s the post type name.
                        'description' => sprintf( __( 'Unique %1$s Identifier. The WordPress Post ID', 'lifterlms' ), $this->post_type ),
                        'type'        => 'integer',
                    ),
                ),
                array(
                    'methods'             => WP_REST_Server::READABLE,
                    'callback'            => array( $this, 'get_content_items' ),
                    'permission_callback' => array( $this->content_controller, 'get_items_permissions_check' ),
                    'args'                => $this->content_controller->get_collection_params(),
                ),
                'schema' => array( $this->content_controller, 'get_public_item_schema' ),

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.