public function render_content() { ?> <div id="widgets-right" class="widget-content"> <label class="customize-control-select"><span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <span class="custom-icon-container"><i class="fa <?php echo esc_attr($this->value()); ?> "></i></span> <input type="hidden" class="image-widget-custom-icon" value="<?php echo esc_attr($this->value()); ?> " <?php $this->link(); ?> /> <a href="#" class="view-icons"><?php _e('View Icons', 'ward'); ?> </a> | <a href="#" class="delete-icon"><?php _e('Remove Icon', 'ward'); ?> </a> <?php bavotasan_font_awesome_icons(false); ?> </label> </div> <?php }
function form($instance) { $instance = wp_parse_args((array) $instance, array('title' => '', 'text' => '', 'icon' => '', 'url' => '', 'button_text' => '', 'button_color' => 'info')); extract($instance); $icon_tag = $icon ? '<i class="fa ' . esc_attr($icon) . '"></i>' : ''; ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'arcade'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($title); ?> " /></p> <p><label><?php _e('Icon:', 'arcade'); ?> </label> <span class="custom-icon-container"><?php echo $icon_tag; ?> </span> <a href="#" class="view-icons"><?php _e('View Icons', 'arcade'); ?> </a> | <a href="#" class="delete-icon"><?php _e('Remove Icon', 'arcade'); ?> </a> <?php bavotasan_font_awesome_icons(); ?> <input class="image-widget-custom-icon" name="<?php echo $this->get_field_name('icon'); ?> " type="hidden" value="<?php echo esc_attr($icon); ?> " /></p> <p><label for="<?php echo $this->get_field_id('url'); ?> "><?php _e('URL:', 'arcade'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('url'); ?> " name="<?php echo $this->get_field_name('url'); ?> " type="text" value="<?php echo esc_attr($url); ?> " /></p> <p><label for="<?php echo $this->get_field_id('button_text'); ?> "><?php _e('Button Text:', 'arcade'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('button_text'); ?> " name="<?php echo $this->get_field_name('button_text'); ?> " type="text" value="<?php echo esc_attr($button_text); ?> " /></p> <p><label for="<?php echo $this->get_field_id('button_color'); ?> "><?php _e('Button & Icon Color:', 'arcade'); ?> </label> <select name="<?php echo $this->get_field_name('button_color'); ?> " id="<?php echo $this->get_field_id('button_color'); ?> " class="widefat"> <?php $options = array('default' => __('Default', 'arcade'), 'info' => __('Light Blue', 'arcade'), 'primary' => __('Blue', 'arcade'), 'danger' => __('Red', 'arcade'), 'warning' => __('Yellow', 'arcade'), 'success' => __('Green', 'arcade')); foreach ($options as $value => $key) { echo '<option value="' . $value . '" ' . selected($button_color, $value, false) . '>' . $key . '</option>'; } ?> </select></p> <textarea class="widefat" rows="8" cols="20" id="<?php echo $this->get_field_id('text'); ?> " name="<?php echo $this->get_field_name('text'); ?> "><?php echo esc_textarea($text); ?> </textarea> <p><input id="<?php echo $this->get_field_id('filter'); ?> " name="<?php echo $this->get_field_name('filter'); ?> " type="checkbox" <?php checked(isset($filter) ? $filter : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?> "><?php _e('Automatically add paragraphs', 'arcade'); ?> </label></p> <?php }
/** * Display Font Awesome icon picker * * @since 1.0.0 */ function bavotasan_font_awesome_picker($display_name = true) { $icons = bavotasan_font_awesome_icons(); ?> <div class="font-awesome-picker"> <?php foreach ($icons as $icon => $code) { ?> <div class="c4" data-value="<?php echo esc_attr($icon); ?> "> <div> <i class="fa <?php echo esc_attr($icon); ?> "></i><?php if ($display_name) { echo $icon; } ?> </div> </div> <?php } ?> </div> <?php }