| | |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\base\Site; |
| | | use JVBase\rest\routes\ContentRoutes; |
| | | use WP_Block; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | |
| | | |
| | | public function __construct() |
| | | { |
| | | $this->cache = Cache::for('timelines', WEEK_IN_SECONDS)->connect('post'); |
| | | $this->cache = Cache::for('timelines', 'post', WEEK_IN_SECONDS); |
| | | if (JVB_TESTING){ |
| | | $this->cache->flush(); |
| | | } |
| | |
| | | } |
| | | $this->content = jvbNoBase($post->post_type); |
| | | |
| | | $this->children = get_children([ |
| | | 'post_parent' => $this->parentID, |
| | | 'post_status' => 'publish', |
| | | 'orderby' => 'date', |
| | | 'order' => 'ASC', |
| | | 'fields' => 'ids' |
| | | ]); |
| | | $this->children = jvbTimelinePoints($this->parentID,$post->post_type); |
| | | $this->total = count($this->children); |
| | | |
| | | ob_start(); |
| | |
| | | protected function renderHeader():void |
| | | { |
| | | $meta = Meta::forPost($this->parentID); |
| | | $sharedFields = JVB()->routes('content')->getTimelineSharedFields($this->content); |
| | | $sharedFields = ContentRoutes::getInstance()->getTimelineSharedFields($this->content); |
| | | $fields = $meta->getAll($sharedFields); |
| | | $extra = $meta->getAll(); |
| | | ?> |
| | |
| | | { |
| | | $all = $this->children; |
| | | array_unshift($all, $this->parentID); |
| | | $uniqueFields = JVB()->routes('content')->getTimelineUniqueFields($this->content); |
| | | $uniqueFields = ContentRoutes::getInstance()->getTimelineUniqueFields($this->content); |
| | | |
| | | foreach ($all as $i => $ID) { |
| | | $meta = Meta::forPost($ID); |