esc_html__("Image with text", 'taskereasy'), "base" => "taskereasy_image_text", 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png', "class" => "", "description" => esc_html__("Add taskereasy image with text", 'taskereasy'), "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'), "params" => array( array( "type" => "dropdown", "heading" => esc_html__("Style", 'taskereasy'), "param_name" => "img_style", "value" => array('Style 1' => 'style1', 'Style 2' => 'style2', 'Style 3' => 'style3', 'Style 4' => 'style4'), ), array( "type" => "param_group", "heading" => esc_html__("Image Block", 'taskereasy'), "param_name" => "img_block", "dependency" => array( 'element' => 'img_style', 'value' => 'style4' ), "params" => array( array( "type" => "attach_image", "heading" => esc_html__("Image", 'taskereasy'), "param_name" => "image", ), array( "type" => "textfield", "heading" => esc_html__("Image Size", 'taskereasy'), "param_name" => "image_size", "description" => 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).' ), array( "type" => "textfield", "heading" => esc_html__("Title", 'taskereasy'), "param_name" => "title", ), array( "type" => "textarea_safe", "heading" => esc_html__("Subtitle", 'taskereasy'), "param_name" => "subtext", ), array( "type" => "textarea_safe", "heading" => esc_html__("Description", 'taskereasy'), "param_name" => "description", ), array( "type" => "textfield", "heading" => esc_html__("Number", 'taskereasy'), "param_name" => "number", ), ), ), array( "type" => "attach_image", "heading" => esc_html__("Image", 'taskereasy'), "param_name" => "image", 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), ), array( "type" => "textfield", "heading" => esc_html__("Image Size", 'taskereasy'), "param_name" => "image_size", 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), "description" => 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).' ), array( "type" => "textfield", "heading" => esc_html__("Title", 'taskereasy'), "param_name" => "title", 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), ), array( "type" => "textarea_safe", "heading" => esc_html__("Subtitle", 'taskereasy'), 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), "param_name" => "subtext", ), array( "type" => "textfield", "heading" => esc_html__("Number", 'taskereasy'), "param_name" => "number", 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), ), array( "type" => "vc_link", "heading" => esc_html__("Button Link", 'taskereasy'), "param_name" => "btn_link", 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), "value" => '' ), array( 'type' => 'dropdown', 'heading' => esc_html__( 'Button Style', 'taskereasy' ), 'param_name' => 'btn_style', 'dependency' => array( 'element' => 'img_style', 'value' => array('style1', 'style2', 'style3') ), 'value' => array('Style 1' => 'style1', 'Style 2' => 'style2') ), array( 'type' => 'css_editor', 'heading' => esc_html__( 'CSS', 'taskereasy' ), 'param_name' => 'custom_design', 'group' => esc_html__( 'Design options', 'taskereasy' ), ) ) )); add_shortcode( 'taskereasy_image_text', function($atts, $content = null) { extract(shortcode_atts(array( 'img_style' => 'style1', 'image' => '', 'image_size' => 'full', 'title' => '', 'img_block' => '', 'subtext' => '', 'number' => '', 'btn_link' => '', 'btn_style' => 'style1', 'custom_design' => '', ), $atts)); $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' ); $imgstyle = html_entity_decode(vc_value_from_safe($img_style, true)); $image_url = html_entity_decode(vc_value_from_safe($image, true)); $img_size = html_entity_decode(vc_value_from_safe($image_size, true)); $imageurl = wp_get_attachment_image_src( $image_url, $img_size ); $title_text = html_entity_decode(vc_value_from_safe($title, true)); $subtitle = html_entity_decode(vc_value_from_safe($subtext, true)); $number = html_entity_decode(vc_value_from_safe($number, true)); $btnlink = vc_build_link( $btn_link); $btn_link = !empty($btnlink['url']) ? $btnlink['url'] : '#'; $btn_title = $btnlink['title']; $btn_target = !empty($btnlink['target']) ? $btnlink['target'] : '_self'; $count = 0; $output = ''; if($imgstyle == 'style1'){ $output .='

'.$title_text.'

'.$subtitle.'

'; if(html_entity_decode(vc_value_from_safe($btn_style, true)) == 'style1'){ $output .= ''.esc_html($btn_title).' '; } if(html_entity_decode(vc_value_from_safe($btn_style, true)) == 'style2'){ $output .= ''.esc_html($btn_title).' '; } $output .= '
image
'; } if($imgstyle == 'style2'){ $output .= '
'.esc_html($number).'
'; if($imageurl[0]){ $output .= 'image'; } $output .= '
'.esc_html($title_text).'

'.esc_html($subtitle).'

'; } if($imgstyle == 'style3'){ $output .= '
'; if($imageurl[0]){ $output .= 'icon'; } $output .= '
'.esc_html($title_text).'

'.esc_html($subtitle).'

'; } if($imgstyle == 'style4'){ $img_block = vc_param_group_parse_atts( $atts['img_block'] ); $output .='
'; foreach ($img_block as $block) { $img_id = $block['image']; $imgurl = wp_get_attachment_image_src($img_id, $img_size); $output .= '
'.esc_html($block['number']).'
'; if(!empty($imgurl[0])){ $output .= 'icon'; } $output.='

'.esc_html($block['subtext']).'

'.esc_html($block['title']).'

'.esc_html($block['description']).'

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