I'll try and make it brief. This snippet:
get_pages(array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-news.php',
));
Is not behaving the same as the following:
get_posts(array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'page-news.php',
));
The 2nd snippet returns the page I'm looking for, but without any hierarchal information.
What I'm trying to do is pull a page out that is using a specific template, including the $page->ancestors attribute.
If need be I can use get_ancestors() later, but it would be nice to have a $page object returned instead of the base $post.
I originally started out with this:
$news_page = query_posts(array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'page-news.php',
'meta_compare' => '=='
));
return $news_page[0];
Even more confusion comes from the fact that the query returns the correct results with a template named page-contact-us.php and page-our-services.php, but not with several others including letterhead.php, page-our-services-sub.php or page-staff.php.