| | |
| | | } |
| | | |
| | | use JVBase\forms\TaxonomySelector; |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\MetaForm; |
| | | use JVBase\meta\MetaManager; |
| | | |
| | |
| | | */ |
| | | function jvbRenderLinks(int $ID, MetaManager|null $meta = null):string |
| | | { |
| | | $cache = CacheManager::for('user_links', WEEK_IN_SECONDS)->connectTo('post')->connectTo('taxonomy'); |
| | | $cache = Cache::for('user_links', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy')->connect('user'); |
| | | $cached = $cache->get($ID); |
| | | if ($cached) { |
| | | return $cached; |
| | |
| | | */ |
| | | function jvbRenderContactInfo(int $ID, MetaManager|null $meta = null):string |
| | | { |
| | | $cache = CacheManager::for('contact', WEEK_IN_SECONDS)->connectTo('post')->connectTo('taxonomy'); |
| | | $cache = Cache::for('contact', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy'); |
| | | |
| | | $cached = $cache->get($ID); |
| | | if($cached){ |
| | |
| | | return ''; |
| | | } |
| | | } |
| | | $cache = CacheManager::for($term->taxonomy); |
| | | $key = $term->term_id.'-link'; |
| | | $cache = Cache::for($term->taxonomy.'_link')->connect('taxonomy'); |
| | | $key = $term->term_id; |
| | | return $cache->remember( |
| | | $key, |
| | | function() use ($term) { |
| | | return '<a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="'.$term->name.'">'. |
| | | $term->name. |
| | | return '<a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="'.html_entity_decode($term->name).'">'. |
| | | html_entity_decode($term->name). |
| | | '</a>'; |
| | | } |
| | | ); |
| | |
| | | return ''; |
| | | } |
| | | |
| | | $cache = CacheManager::for('locations')->connectTo('taxonomy'); |
| | | $cache = Cache::for('locations')->connect('taxonomy'); |
| | | $key = $cache->generateKey($location); |
| | | |
| | | $cached = false; |