| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => 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 .= '<div class="row">';
- foreach ($iconlists as $iconlist) {
- $margin = ($count%2 != 0) ? 'top-margin' : 'bottom-margin';
- $iconcolor = (isset($iconlists[$count]["icon_color"]))? $iconlists[$count]["icon_color"] : ' ' ;
- $output .= '<div class="col-md-6">
- <div class="facts-box '.esc_attr($margin).'" style="background-color: '.esc_attr($iconcolor).'">';
- if(isset($iconlists[$count]['icon'])){
- $output .= '<div class="icon-wp">
- <i class="'.esc_attr($iconlists[$count]['icon']).'"></i>
- </div>';
- }
- if(isset($iconlists[$count]['number'])){
- $output .= '<h3>'.esc_html($iconlists[$count]['number']).'</h3>';
- }
- if(isset($iconlists[$count]['subtext'])) {
- $output .= '<p>'.esc_html($iconlists[$count]['subtext']).'</p>';
- }
- $output .= '</div>
- </div>';
- $count++;
- }
- $output .= '</div>';
- return $output;
- });
|