PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
themes
/
webon
/
inc
/
nav-menu
<?php if ( ! function_exists( 'webon_nav_item_classes' ) ) { /** * Function that add additional classes for menu items * * @param array $classes The CSS classes that are applied to the menu item's `<li>` element. * @param WP_Post $item The current menu item. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * * @return array */ function webon_nav_item_classes( $classes, $item, $args, $depth ) { if ( $depth == 0 && in_array( 'menu-item-has-children', $item->classes ) ) { $classes[] = 'qodef-menu-item--narrow'; } return $classes; } add_filter( 'nav_menu_css_class', 'webon_nav_item_classes', 10, 4 ); } if ( ! function_exists( 'webon_add_nav_item_description' ) ) { /** * Function that add additional element before the menu item title * * @param string $title The menu item's title. * @param WP_Post $item The current menu item. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * * @return string */ function webon_add_nav_item_description( $title, $item, $args, $depth ) { if ( 0 === $depth ) { // Wrap the menu item title with additional html $title = '<span class="qodef-menu-item-label">' . $title . '</span>'; if ( ! empty( $item->description ) ) { $title = '<span class="qodef-menu-item-description">' . wp_kses_post( $item->description ) . '</span>' . $title; } } return $title; } add_filter( 'nav_menu_item_title', 'webon_add_nav_item_description', 10, 4 ); } if ( ! function_exists( 'webon_add_nav_item_icon' ) ) { /** * Function that add additional element after the menu title * * @param string $title The menu item's title. * @param WP_Post $item The current menu item. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * * @return string */ function webon_add_nav_item_icon( $title, $item, $args, $depth ) { if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { $title .= webon_get_svg_icon( 'menu-arrow-right', 'qodef-menu-item-arrow' ); } return $title; } add_filter( 'nav_menu_item_title', 'webon_add_nav_item_icon', 15, 4 ); // permission 15 is set in order to be after the item description hook }
[+]
..
[-] include.php
[edit]
[-] helper.php
[edit]