diff --git a/lib/class-wp-rest-site-controller.php b/lib/class-wp-rest-site-controller.php index dea1d96..97b6e69 100644 --- a/lib/class-wp-rest-site-controller.php +++ b/lib/class-wp-rest-site-controller.php @@ -17,16 +17,40 @@ public function __construct() { public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( $this, 'get_items' ), - 'args' => $this->get_collection_params(), + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_items' ), + 'args' => $this->get_collection_params(), + 'permission_callback' => array( $this, 'get_items_permissions_check' ), ), - 'schema' => array( $this, 'get_public_item_schema' ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) ); + + register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P