namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => array( 'force' => array( 'description' => __( 'Bypass the cached list and rebuild from the database.', 'accessibility-plus' ), 'type' => 'boolean', 'default' => false, 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ), ), ), ) ); } /** * GET /wya11y/v1/auditable-urls * * @param \WP_REST_Request $request Request object. * @return \WP_REST_Response */ public function get_items( $request ) { $force = (bool) $request->get_param( 'force' ); $data = Auditable_Urls::get_instance()->get( $force ); return rest_ensure_response( $data ); } }