FEEDBACK Make page-icon clickable by moving it inside list-item link
This commit is contained in:
parent
44217cdb11
commit
179cfd2e98
|
|
@ -9,12 +9,10 @@ function carhop_wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
|||
if ($args->theme_location === "primary") {
|
||||
$page_icon = get_field('page_icon', $item->object_id);
|
||||
|
||||
|
||||
|
||||
if (isset($page_icon)) {
|
||||
$icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
|
||||
$link = $output;
|
||||
$output = $icon . $link;
|
||||
// Insérer l'icône à l'intérieur du lien (seulement la première occurrence)
|
||||
$output = preg_replace('/>/', '>' . $icon, $output, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user