Baza wiedzy
$posts = get_posts(array(
'post_status' => [’publish’, 'future’],
'posts_per_page’ => -1
));
$categories = [];
foreach ($posts as $post) {
$post_categories = wp_get_post_categories($post->ID);
foreach ($post_categories as $cat_id) {
$categories[] = get_category($cat_id);
}
}
$categories = array_values(array_unique($categories, SORT_REGULAR));
?>
Najnowsze oferty pracy