/** * Get the ancestors. * * @uses \get_post_ancestors() * * @return \Illuminate\Support\Collection|\Luminous\Bridge\Post\Entity[] */ protected function getAncestorsAttribute() { $ancestors = array_map(function ($id) { return WP::post($id); }, get_post_ancestors($this->original)); return new Collection($ancestors); }