* http://www.gnu.org/licenses/gpl-3.0.txt */ /** * Awesome Icon Admin View * * @package Yithemes * @author Emanuela Castorina <*****@*****.**> * @since 1.0.0 */ extract($args); if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $current_options = wp_parse_args($args['value'], $args['std']); $current_icon = YPOP_Icon()->get_icon_data($current_options['icon']); $options['icon'] = YIT_Plugin_Common::get_icon_list(); ?> <div id="<?php echo $id; ?> -container" <?php if (isset($deps)) { ?> data-field="<?php echo $id; ?> " data-dep="<?php
function get_icon_data($icon) { $icon_list = YIT_Plugin_Common::get_icon_list(); $icon_data = ''; if ($icon != '') { $ic = explode(':', $icon); if (count($ic) < 2) { return $icon_data; } $icon_code = array_search($ic[1], $icon_list[$ic[0]]); if ($icon_code) { $icon_code = strpos($icon_code, '\\') === 0 ? '&#x' . substr($icon_code, 1) . ';' : $icon_code; } $icon_data = 'data-font="' . esc_attr($ic[0]) . '" data-name="' . esc_attr($icon_code) . '" data-key="' . esc_attr($ic[1]) . '" data-icon="' . $icon_code . '"'; } return $icon_data; } } /** * Return the instance of YPOP_Icon class * * @return \YPOP_Icon * @since 2.0.0 * @author Emanuela Castorina <*****@*****.**> */ function YPOP_Icon() { return YPOP_Icon::get_instance(); } YPOP_Icon(); }