| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html("Address", 'taskereasy'),
- "base" => "taskereasy_address",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html("Add taskereasy Address", 'taskereasy'),
- "category" => esc_html('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- 'type' => 'param_group',
- 'heading' => esc_html( 'Address', 'taskereasy' ),
- 'param_name' => 'address',
- 'params' => array(
- array(
- "type" => "textfield",
- "heading" => esc_html("Title", 'taskereasy'),
- "param_name" => "title",
- ),
- array(
- "type" => "textarea_safe",
- "heading" => esc_html("Address", 'taskereasy'),
- "param_name" => "subtext",
- ),
- array(
- "type" => "iconpicker",
- "heading" => esc_html("Address Icon", 'taskereasy'),
- "param_name" => "adrs_icon",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html("Email Address", 'taskereasy'),
- "param_name" => "email",
- ),
- array(
- "type" => "iconpicker",
- "heading" => esc_html("Email Icon", 'taskereasy'),
- "param_name" => "email_icon",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html("Phone", 'taskereasy'),
- "param_name" => "phone",
- ),
- array(
- "type" => "iconpicker",
- "heading" => esc_html("Phone Icon", 'taskereasy'),
- "param_name" => "phn_icon",
- ),
- )
- ),
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html( 'Design options', 'taskereasy' ),
- )
- )
- ));
- add_shortcode( 'taskereasy_address', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'title' => ' ',
- 'subtext' => '',
- 'adrs_icon' => '',
- 'email' => '',
- 'email_icon' => '',
- 'phone' => '',
- 'phn_icon' => '',
- 'custom_design' => '',
- ), $atts));
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $addresslists = vc_param_group_parse_atts( $atts['address'] );
- $output = '';
- $count = 0;
- foreach ($addresslists as $addresslist) {
- $title = ($addresslists[$count]['title'])? $addresslists[$count]['title'] : ' ';
- $subtext = ($addresslists[$count]['subtext'])? $addresslists[$count]['subtext'] : ' ';
- $email = ($addresslists[$count]['email'])? $addresslists[$count]['email'] : ' ';
- $phone = ($addresslists[$count]['phone'])? $addresslists[$count]['phone'] : ' ';
- $adricon = ($addresslists[$count]['adrs_icon'])? $addresslists[$count]['adrs_icon'] : 'fa fa-map-marker';
- $email_icon = ($addresslists[$count]['email_icon'])? $addresslists[$count]['email_icon'] : 'fa fa-envelop';
- $phn_icon = ($addresslists[$count]['phn_icon'])? $addresslists[$count]['phn_icon'] : 'fa fa-mobile';
- $output .='
- <div class="address-wrap">
- <h4>'.esc_html($title).'</h4>
- <div class="address">
- <i class="'.esc_html($adricon).'"></i>
- <p>'.esc_html($subtext).' </p>
- </div>
- <div class="email">
- <i class="'.esc_html($email_icon).'"></i>
- <p><a href="'.esc_html($email).'">'.esc_html($email).'</a></p>
- </div>
- <div class="phone">
- <i class="'.esc_html($phn_icon).'"></i>
- <p>'.esc_html($phone).' </p>
- </div>
- </div>';
- $count++;
- }
- return $output;
- });
|