| | |
| | | <?php |
| | | namespace JVBase\blocks; |
| | | |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\forms\TaxonomySelector; |
| | | use WP_Block; |
| | | |
| | |
| | | |
| | | class SummaryBlock |
| | | { |
| | | protected CacheManager $cache; |
| | | protected Cache $cache; |
| | | protected string $config; |
| | | protected string $type; |
| | | protected string $path = JVB_DIR . '/build/summary'; |
| | |
| | | |
| | | public function __construct() |
| | | { |
| | | $this->cache = CacheManager::for('summary_block', WEEK_IN_SECONDS); |
| | | $this->cache = Cache::for('summary_block', WEEK_IN_SECONDS); |
| | | add_action('init', [ $this, 'registerBlock' ]); |
| | | if (JVB_TESTING) { |
| | | $this->cache->clear(); |
| | | $this->cache->flush(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | protected function renderHeader():void |
| | | { |
| | | ob_start(); |
| | | ?> |
| | | <header id="top"> |
| | | <?php if ($this->image !== ''): ?> |
| | |
| | | <?php endif; ?> |
| | | </header> |
| | | <?php |
| | | $out = ob_get_clean(); |
| | | |
| | | |
| | | echo apply_filters( |
| | | 'jvbSummaryHeaderOutput', |
| | | $out, |
| | | $this->header, |
| | | $this->headerExtra |
| | | ); |
| | | } |
| | | |
| | | protected function renderDetails():void |