This is what i ended up doing since i found no other way
//Fetch all pages
$pages = get_pages( array(
'post_type' => 'page',
'meta_key' => 'review_date',
//'meta_key' => 'reviewed_by_user_id',
'sort_column' => 'review_date',
'sort_order' => 'asc'
));
//Fetch metadata for each page
$ordered_pages = array();
foreach ($pages as $page)
{
$metadata = get_metadata('post', $page->ID);
$user = $metadata['reviewed_by_user_id'][0];
$date = $metadata['review_date'][0];
array_push($ordered_pages, array(
'ID' => $page->ID,
'title' => $page->post_title,
'review_date' => $date,
'reviewed_by_user_id' => $user,
'link' => get_edit_post_link($page->ID),
));
}
//Order the pages
$orderby_array = array();
foreach ($ordered_pages as $key => $row)
{
$orderby_array[$key] = $row[$orderby];
}
array_multisort($orderby_array, SORT_DESC, $ordered_pages);
and then looping trough the pages like this
foreach ($ordered_pages as $page)
{
//Some code
}
Its not pretty and it generates lot of extra db calls with the get_metadata call but since its a rarely viewed page in admin it’s ok for me.