0

This question already has an answer here:

I have a get_pages() function. I all works great but I only want all the post_id's in my variable. Is that possible?

Thanks in advance.

$countries = get_pages(array(
    "hierarchical" => 0, 
    "sort_column" => "menu_order", 
    "sort_order" => "desc", 
    "meta_key" => "page_type", 
    "meta_value" => 2,
));

marked as duplicate by fuxia Oct 5 '16 at 9:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Quick shot:

$countries = get_pages(array(
    "hierarchical" => 0, 
    "sort_column"  => "menu_order", 
    "sort_order"   => "desc", 
    "meta_key"     => "page_type", 
    "meta_value"   => 2,
));
$page_ids = array();
foreach ( $countries as $country ) {
    $page_ids[] = $country->ID;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.