Esempio n. 1
0
 public static function list_($atts = null, $content = null)
 {
     $atts = shortcode_atts(array('icon' => '', 'class' => ''), $atts, 'list');
     $icon_type = false === strpos($atts['icon'], 'icon:') ? 'image-icon' : 'font-icon';
     $uniq_class = 'cherry-list_' . rand(1000, 9999);
     $classes = array('cherry-list', $icon_type, $uniq_class, cherry_esc_class_attr($atts));
     $class = implode(' ', $classes);
     $output = '<div class="' . $class . '">';
     $output .= Cherry_Shortcodes_Tools::append_icons($content, $atts['icon']);
     if ('image-icon' == $icon_type) {
         $style = '.' . $uniq_class . ' ul li:before {background-image: url(' . $atts['icon'] . '); }';
         $output .= sprintf('<style>%s</style>', $style);
     }
     $output .= '</div>';
     return apply_filters('cherry_shortcodes_output', $output, $atts, 'list');
 }