commenting unecessary renovateur walker
This commit is contained in:
parent
2f046b6694
commit
5c1d7a6076
|
|
@ -17,39 +17,37 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #### MENU RENOVATEUR — FOOTER — N'est pas utilisé pour le menu principal
|
// #### MENU RENOVATEUR
|
||||||
if ($args->theme_location === "renovateur") {
|
// if ($args->theme_location === "renovateur") {
|
||||||
$page_icon = get_field('page_icon', $item->object_id);
|
// $page_icon = get_field('page_icon', $item->object_id);
|
||||||
|
|
||||||
if (in_array('menu-item-has-children', $item->classes, true)) {
|
// if (in_array('menu-item-has-children', $item->classes, true)) {
|
||||||
$output = '<button type="button" class="footer__submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
// $output = '<button type="button" class="footer__submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||||
}
|
|
||||||
|
|
||||||
// #### ICONE DE PAGE FOR TOP LEVEL MENU ITEMS
|
|
||||||
if (isset($page_icon['url'])) {
|
|
||||||
$icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
|
|
||||||
$link = $output;
|
|
||||||
$output = $icon . $link;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #### TAXONOMY : GET ICON & INFOS ABOUT TAX
|
|
||||||
|
|
||||||
if ($item->type === "taxonomy") {
|
|
||||||
$term = get_term_by('id', $item->object_id, 'thematiques');
|
|
||||||
$cover = get_field('taxonomy_pictures', "thematiques_" . $item->object_id);
|
|
||||||
|
|
||||||
$output = '<a class="lol" href="' . $item->url . '">';
|
|
||||||
$output .= '<img class="thematique-icon" src="' . $cover['icon']['url'] . '"/>';
|
|
||||||
$output .= '<h6>' . $item->title . "</h6>";
|
|
||||||
$output .= '<p>' . $term->description . "</p>";
|
|
||||||
$output .= "</a>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
|
||||||
// $output = $item->title;
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// // #### ICONE DE PAGE FOR TOP LEVEL MENU ITEMS
|
||||||
|
// if (isset($page_icon['url'])) {
|
||||||
|
// $icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
|
||||||
|
// $link = $output;
|
||||||
|
// $output = $icon . $link;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// // #### TAXONOMY : GET ICON & INFOS ABOUT TAX
|
||||||
|
|
||||||
|
// if ($item->type === "taxonomy") {
|
||||||
|
// $term = get_term_by('id', $item->object_id, 'thematiques');
|
||||||
|
// $cover = get_field('taxonomy_pictures', "thematiques_" . $item->object_id);
|
||||||
|
|
||||||
|
// $output = '<a class="lol" href="' . $item->url . '">';
|
||||||
|
// $output .= '<img class="thematique-icon" src="' . $cover['icon']['url'] . '"/>';
|
||||||
|
// $output .= '<h6>' . $item->title . "</h6>";
|
||||||
|
// $output .= '<p>' . $term->description . "</p>";
|
||||||
|
// $output .= "</a>";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user