| | |
| | | <?php |
| | | namespace JVBase\forms; |
| | | |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use WP_REST_Request; |
| | | use WP_REST_Response; |
| | | use WP_Query; |
| | |
| | | { |
| | | protected string $post_type; |
| | | protected array $config; |
| | | protected CacheManager $cache; |
| | | protected Cache $cache; |
| | | |
| | | public function __construct(string $post_type, array $config = []) |
| | | { |
| | | $this->post_type = $post_type; |
| | | $this->cache = CacheManager::for(jvbNoBase($post_type), WEEK_IN_SECONDS); |
| | | $this->cache = Cache::for(jvbNoBase($post_type), WEEK_IN_SECONDS)->connect('post', true); |
| | | |
| | | $this->config = wp_parse_args($config, [ |
| | | 'multiple' => true, |
| | |
| | | */ |
| | | public function render(array $selected = [], string $containerId = ''): string |
| | | { |
| | | // Mark that selectors are present for footer output |
| | | TaxonomySelector::markSelectorsPresent(); |
| | | |
| | | // Process selected posts |
| | | $processedSelected = $this->processSelectedPosts($selected); |
| | | |