get_pages()
is a valid function, but it doesn't have any parameters for getting pages with specific taxonomy terms assigned.
WP_Query
will get posts of any type (such as Pages) and can query by taxonomy terms. If you don't want to look through your plugin's code to find out what it calls the Page Tag taxonomy, in wp-admin, go to Pages > Tags and look at the URL. You will have something like /wp-admin/edit-tags.php?taxonomy=thetaxonomyname
- thetaxonomyname
is what you're looking for. It will be post_tag
if it's regular Core tags but could be something different depending on the plugin. Once you know for sure what your taxonomy is called, you can plug that into the tax_query
portion of WP_Query
.
From OP's comment, the final code is
<?php
$pages = new WP_Query(
array(
'showposts' => -1,
'tag' => 'thetaxonomyname',
'meta_key' => 'date',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'post_type' => array( 'post', 'page' )
)
);
print_r($pages);
?>