function kleo_vc_iconpicker_fontello($icons) { $fontello_icons = kleo_icons_array(''); $arranged_icons = array(); if ($fontello_icons) { foreach ($fontello_icons as $k => $icon) { $arranged_icons[][$k] = $icon; } } $f_icons = array($arranged_icons); return array_merge($icons, $f_icons); }
/** * @see Walker::start_el() * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param object $args */ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { parent::start_el($output, $item, $depth, $args, $id); $item_id = esc_attr($item->ID); $to_add = ''; $icon_opts = ''; foreach (kleo_icons_array() as $icon) { $selected_icon = $item->icon == $icon ? ' selected="selected"' : ''; $icon_opts .= '<option value="' . $icon . '"' . $selected_icon . '>' . $icon . '</option> '; } $to_add .= '<p class="menu-item-icons">' . '<label for="edit-menu-item-icons-' . $item_id . '">' . __('Choose icon', 'kleo_framework') . ' <select id="edit-menu-item-icon-' . $item_id . '" name="menu-item-icon[' . $item_id . ']">' . $icon_opts . '</select>' . ' <select id="edit-menu-item-iconpos-' . $item_id . '" name="menu-item-iconpos[' . $item_id . ']">' . '<option value="">' . __('Before title', 'kleo_framework') . '</option>' . '<option' . ($item->iconpos == 'after' ? ' selected="selected"' : '') . ' value="after">' . __('After title', 'kleo_framework') . '</option>' . '<option ' . ($item->iconpos == 'icon' ? ' selected="selected"' : '') . ' value="icon">' . __('Just the icon', 'kleo_framework') . '</option>' . '</select>' . '</label>' . '</p>'; if ($depth == 0) { $to_add .= '<p class="menu-item-mega"> <label for="edit-menu-item-mega-' . $item_id . '"> <input type="checkbox" id="edit-menu-item-mega-' . $item_id . '" value="yes" name="menu-item-mega[' . $item_id . ']"' . ($item->mega == 'yes' ? 'checked="checked"' : '') . ' />' . __('Enable Mega Menu for child items.', 'kleo_framework') . '</label> </p>'; } ob_start(); // action for other plugins do_action('wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args); $to_add .= ob_get_clean(); $output = str_replace('<label for="edit-menu-item-target-' . $item_id . '">', '</p>' . $to_add . '<p class="field-link-target description"><label for="edit-menu-item-target-' . $item_id . '">', $output); }