/** * {@inheritdoc} */ protected function getTree() { $tree = parent::getTree(); if ($this->post->type->hierarchical) { foreach ($this->post->ancestors->reverse() as $ancestor) { $tree[] = new Node($ancestor); } } $tree[] = new Node($this->post); return $tree; }
/** * {@inheritdoc} */ protected function getTree() { $tree = parent::getTree(); if ($this->term) { if ($this->term->type->hierarchical) { foreach ($this->term->ancestors->reverse() as $ancestor) { $tree[] = new Node($ancestor, $this->postType); } } $tree[] = new Node($this->term, $this->postType); } if ($this->date) { $tree[] = new Node($this->date, $this->postType); } return $tree; }