PHP
0
Вклад в тег
function get_custom_post_extended() {
$args = array('post_type' => 'page');
$customLoop = new WP_Query($args);
$all_post_type = array(
'books',
'reviews',
'news',
'overviews',
'texts',
'interviews',
'chronicles',
'afisha',
);
while ($customLoop->have_posts()) :
$customLoop->the_post();
$get_type = get_post_meta(get_the_ID(), 'custom_type')[0];
if ($get_type != NULL) {
array_push( $all_post_type, $get_type);
}
endwhile;
return $all_post_type;
}