esc_html__("Counter", 'taskereasy'), "base" => "taskereasy_counter", 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png', "class" => "", "description" => esc_html__("Add taskereasy counter", 'taskereasy'), "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'), "params" => array( array( "type" => "param_group", "heading" => esc_html__("Icon List", 'taskereasy'), "param_name" => "icon_list", "params" => array( array( "type" => "iconpicker", "heading" => esc_html__("Icon", 'taskereasy'), "param_name" => "icon", ), array( "type" => "textfield", "heading" => esc_html__("Number", 'taskereasy'), "param_name" => "number", ), array( "type" => "textarea_safe", "heading" => esc_html__("Subtitle", 'taskereasy'), "param_name" => "subtext", ), array( 'type' => 'colorpicker', 'heading' => esc_html__( 'Icon Background', 'taskereasy' ), 'param_name' => 'icon_color', ), ), ), array( 'type' => 'css_editor', 'heading' => esc_html__( 'CSS', 'taskereasy' ), 'param_name' => 'custom_design', 'group' => esc_html__( 'Design options', 'taskereasy' ), ) ) )); add_shortcode( 'taskereasy_counter', function($atts, $content = null) { extract(shortcode_atts(array( 'icon' => '', 'number' => '', 'subtext' => '', 'icon_color' => '#000000', 'custom_design' => '', ), $atts)); $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' ); $iconlists = vc_param_group_parse_atts( $atts['icon_list'] ); $output = ''; $count = 0; $output .= '
'; foreach ($iconlists as $iconlist) { $margin = ($count%2 != 0) ? 'top-margin' : 'bottom-margin'; $iconcolor = (isset($iconlists[$count]["icon_color"]))? $iconlists[$count]["icon_color"] : ' ' ; $output .= '
'; if(isset($iconlists[$count]['icon'])){ $output .= '
'; } if(isset($iconlists[$count]['number'])){ $output .= '

'.esc_html($iconlists[$count]['number']).'

'; } if(isset($iconlists[$count]['subtext'])) { $output .= '

'.esc_html($iconlists[$count]['subtext']).'

'; } $output .= '
'; $count++; } $output .= '
'; return $output; });