我有一个get\\u pages()函数。我的工作都很好,但我只希望所有post\\u id都在我的变量中。这可能吗?
提前谢谢。
$countries = get_pages(array(
"hierarchical" => 0,
"sort_column" => "menu_order",
"sort_order" => "desc",
"meta_key" => "page_type",
"meta_value" => 2,
));
最合适的回答,由SO网友:websupporter 整理而成
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;
}