| | |
| | | parent::__construct(); |
| | | // $this->cache->invalidateGroup('terms'); |
| | | $this->per_page = 20; |
| | | |
| | | add_action('edited_term', [$this, 'deleteTermPath']); |
| | | add_action('wp_login', [$this, 'clearUserTaxonomyCache'], 10, 2); |
| | | } |
| | |
| | | public function handleTermSelectionRequest(WP_REST_Request $request):WP_REST_Response |
| | | { |
| | | $data = $request->get_params(); |
| | | $taxonomy = jvbCheckBase($data['taxonomy'])??''; |
| | | |
| | | $taxonomy = sanitize_text_field($data['taxonomy'])??''; |
| | | // Check HTTP cache headers |
| | | $cache_check = $this->checkHeaders($request, $taxonomy); |
| | | if ($cache_check) { |
| | |
| | | if (str_contains($taxonomy, ',')) { |
| | | return $this->handleBatchTermRequest($taxonomy, $data, $request); |
| | | } |
| | | $taxonomy = jvbCheckBase($taxonomy); |
| | | |
| | | if (array_key_exists('termIDs', $data)) { |
| | | $args = [ |