| | |
| | | 'context' => 'string', |
| | | 'contextId' => 'string', |
| | | 'favourites' => 'boolean', |
| | | 'user' => 'integer', |
| | | 'highlight' => 'string', |
| | | ]) |
| | | ->auth('public') |
| | |
| | | 'context' => 'string', |
| | | 'contextId' => 'string', |
| | | 'favourites' => 'boolean', |
| | | 'user' => 'integer', |
| | | 'highlight' => 'string', |
| | | ]) |
| | | ->auth('public') |
| | |
| | | */ |
| | | protected function applyFavouritesFilter(array $args, array $data): array |
| | | { |
| | | if (empty($data['favourites']) || empty($data['user'])) { |
| | | if (empty($data['favourites'])) { |
| | | return $args; |
| | | } |
| | | |
| | | $user_id = (int)$data['user']; |
| | | $user_id = get_current_user_id(); |
| | | if (!$user_id) { |
| | | //Shouldn't happen, but whatever |
| | | return $args; |
| | | } |
| | | $content = jvbNoBase($args['post_type']); |
| | | |
| | | // Get user's favourites for this content type |