| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Pricing", 'taskereasy'),
- "base" => "taskereasy_pricing",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy pricing", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- "type" => "param_group",
- "heading" => esc_html__("Price List", 'taskereasy'),
- "param_name" => "price_list",
- "params" => array(
- array(
- "type" => "textfield",
- "heading" => esc_html__("Title", 'taskereasy'),
- "param_name" => "title",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("price", 'taskereasy'),
- "param_name" => "price",
- ),
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Limit', 'taskereasy' ),
- 'param_name' => 'limit',
- 'value' => array('Monthly' => 'monthly', 'Yearly' => 'yearly'),
- ),
- array(
- "type" => "param_group",
- "heading" => esc_html__("Features", 'taskereasy'),
- "param_name" => "features",
- "params" => array(
- array(
- "type" => "textfield",
- "heading" => esc_html__("", 'taskereasy'),
- "param_name" => "feature",
- ),
- )
- ),
- array(
- 'type' => 'checkbox',
- 'heading' => esc_html__( 'Plan Tag', 'taskereasy' ),
- 'param_name' => 'plan_tag',
- 'value' => ''
- ),
- array(
- 'type' => 'vc_link',
- 'heading' => esc_html__( 'Button Link', 'taskereasy' ),
- 'param_name' => 'btn_link',
- ),
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Button Style', 'taskereasy' ),
- 'param_name' => 'btn_style',
- '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_pricing', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'price_list' => '',
- 'custom_design' => '',
- 'btn_style' => 'style1',
- 'btn_link' => '',
- 'plan_tag' => '',
- ), $atts));
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $pricelist = vc_param_group_parse_atts( $atts['price_list'] );
- $output = '';
- $count = 0;
- $output .='<div class="price-section">
- <div class="row">';
- foreach ($pricelist as $price) {
- $count_feature = 0;
- $features_list = vc_param_group_parse_atts($pricelist[$count]['features']);
- $btnlink = vc_build_link( $pricelist[$count]['btn_link'] );
- $btn_link = !empty($btnlink['url']) ? $btnlink['url'] : '#';
- $btn_title = $btnlink['title'];
- $btn_target = !empty($btnlink['target']) ? $btnlink['target'] : '_self';
- $output .= '<div class="col-lg-4">
- <div class="price-wrap">';
- if(isset($pricelist[$count]['plan_tag']) ){
- $output .= '<div class="plan-tag">'.esc_html__("Popular", "taskereasy").'</div>';
- }
- $output .= '<h5>'.esc_html($pricelist[$count]['title']).'</h5>
- <div class="price">$'.esc_html($pricelist[$count]['price']).' <span>/'.esc_html($pricelist[$count]['limit']).'</span></div>
- <ul>';
- foreach ( $features_list as $feature) {
- $output .= '<li>'.esc_html($features_list[$count_feature]['feature']).'</li>';
- $count_feature++;
- }
- $output .='</ul>';
- if(html_entity_decode(vc_value_from_safe($btn_style, true)) == 'style1'){
- if($btn_title){
- $output .= '<a href="'.esc_url($btn_link).'" class="btn" target="'.esc_attr($btn_target).'" >'.esc_html($btn_title).' <i class="fa fa-angle-right"></i></a>';
- }
- }
- if(html_entity_decode(vc_value_from_safe($btn_style, true)) == 'style2'){
- if($btn_title){
- $output .= '<a href="'.esc_url($btn_link).'" class="btn btn-secondary" target="'.esc_attr($btn_target).'">'.esc_html($btn_title).' <i class="fa fa-angle-right"></i></a>';
- }
- }
- $output .= '</div>
- </div>
- ';
- $count++;
- }
- $output .= '</div> </div>';
- return $output;
- });
|