$courses = get_posts(array(
'numberposts' => -1,
'tax_query' => array( array (
'taxonomy' => 'type_course',
'field' => 'term_id',
'terms' => $courses_cat->term_id
) )
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'courses',
'suppress_filters' => true,
));
add_filter('wp_nav_menu_objects', function ($items) {
foreach ($items as $item) {
if ($item->url == 'https://example.com/page1/') {
$item->url = 'https://example.com/another-page/';
// Или вариант для удаления ссылки:
// $item->url = null;
}
}
return $items;
});
function has_children()
{
return (bool)get_pages(array(
'child_of' => get_the_ID(),
'number' => 1
));
}