| | |
| | | 'highlight' => 'string', |
| | | ]) |
| | | ->auth('public') |
| | | ->rateLimit(30, 60); |
| | | ->rateLimit(30) |
| | | ->register(); |
| | | |
| | | // Feed types endpoint |
| | | Route::for('feed/types') |
| | | ->get([$this, 'getFeedTypes']) |
| | | ->auth('public') |
| | | ->rateLimit(60, 60); |
| | | ->rateLimit() |
| | | ->register(); |
| | | } |
| | | |
| | | /** |
| | |
| | | $meta = Meta::forTerm($postID); |
| | | $config = JVB_TAXONOMY[$type]; |
| | | break; |
| | | case 'user': |
| | | $meta = Meta::forUser($postID); |
| | | $config = JVB_USER[$type]; |
| | | break; |
| | | } |
| | | if (!$config) { |
| | | return []; |
| | |
| | | public function getFeedTypes(WP_REST_Request $request): WP_REST_Response |
| | | { |
| | | // Check HTTP cache |
| | | $cache_check = $this->checkHeaders($request, ['feed_types']); |
| | | $cache_check = $this->checkHeaders($request, 'feed_types'); |
| | | if ($cache_check) { |
| | | return $cache_check; |
| | | } |