get_post_ancestors returns empty April 21, 2022 by Tarik Billa use: $ancestors = get_ancestors($id,'page'); get_ancestors()