namespace, '/' . $this->base . '/', [ [ 'methods' => WP_REST_Server::READABLE, 'callback' => [$this, 'get_items'], 'permission_callback' => [$this, 'check_permission'], 'args' => $this->get_collection_params(), 'schema' => [$this, 'get_item_schema'], ], ] ); } /** * Retrieves a collection of job items. * * @since 1.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items($request): ?WP_REST_Response { $data = Data::getWorkExperience(); return rest_ensure_response($data); } /** * Retrieves the query params for collections. * * @since 1.0.0 * * @return array */ public function get_collection_params(): array { $params = parent::get_collection_params(); $params['limit']['default'] = AXILWEB_AJL_POSTS_PER_PAGE; $params['s']['default'] = ''; return $params; } }