| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Testimonials
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Single Image", 'taskereasy'),
- "base" => "taskereasy_singelimage",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy single image", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- "type" => "attach_image",
- "heading" => esc_html__("Image", 'taskereasy'),
- "param_name" => "image",
- ),
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Size", 'taskereasy'),
- "param_name" => "image_size",
- "value" => array('Full' => 'full', 'Medium' => 'medium', 'Thumbnail' => 'thumbnail' ),
- ),
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html__( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html__( 'Design options', 'taskereasy' ),
- )
- )
- )
- );
- add_shortcode( 'taskereasy_singelimage', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'image' => '',
- 'image_size' => 'full',
- 'custom_design' => '',
- ), $atts));
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $output = '';
- $image = html_entity_decode(vc_value_from_safe($image, true));
- $img_size = html_entity_decode(vc_value_from_safe($image_size, true));
- $image_url = wp_get_attachment_image_src( $image, $img_size );
- $output .='
- <div class="single-image-section image-'.esc_attr($img_size).' '.esc_attr($custom_design).'">
- <div class="vc-image">
- <img src="'.esc_url($image_url[0]).'" alt="image">
- </div>';
- $output .='</div>';
- return $output;
- });
|