File: /home/dermova/public_html/india/wp-content/plugins/rit-core/inc/shortcode/testimonial.php
<?php
/**
* RIT Core Plugin
* @package RIT Core
* @version 0.1
* @author CleverSoft
* @link http://cleversoft.co
* @copyright Copyright (c) 2015 CleverSoft
* @license GPL v2
*/
if (!function_exists('rit_shortcode_testimonial')) {
function rit_shortcode_testimonial($atts)
{
$atts = shortcode_atts(array(
'title' => '',
'text_size' => '',
'item_count' => '-1',
'order' => '',
'category' => '',
'pagination' => 'no',
'page_link' => '',
'el_class' => '',
), $atts);
$layout_type = ($atts['testimonial_layout'] != '') ? $atts['testimonial_layout'] : 'large';
return rit_get_template_part('shortcode', 'testimonial-' . $layout_type, array('atts' => $atts));
}
}
add_shortcode('testimonial', 'rit_shortcode_testimonial');
add_action('vc_before_init', 'rit_testimonial_integrate_vc');
if (!function_exists('rit_testimonial_integrate_vc')) {
function rit_testimonial_integrate_vc()
{
vc_map( array(
"name" => esc_html__("Testimonials", RIT_TEXT_DOMAIN),
"base" => "testimonial",
"class" => "",
"icon" => "spb-icon-testimonial",
"wrapper_class" => "clearfix",
"controls" => "full",
"params" => array(
array(
"type" => "textfield",
"heading" => esc_html__("Title", RIT_TEXT_DOMAIN),
"param_name" => "title",
"value" => "",
"description" => esc_html__("Heading text. Leave it empty if not needed.", RIT_TEXT_DOMAIN)
),
array(
"type" => "dropdown",
"heading" => esc_html__("Text size", RIT_TEXT_DOMAIN),
"param_name" => "text_size",
"value" => array(
esc_html__('Normal', RIT_TEXT_DOMAIN) => "normal",
esc_html__('Large', RIT_TEXT_DOMAIN) => "large"
),
"description" => esc_html__("Choose the size of the text.", RIT_TEXT_DOMAIN)
),
array(
"type" => "textfield",
"class" => "",
"heading" => esc_html__("Number of items", RIT_TEXT_DOMAIN),
"param_name" => "item_count",
"value" => "6",
"description" => esc_html__("The number of testimonials to show per page. Leave blank to show ALL testimonials.", RIT_TEXT_DOMAIN)
),
array(
"type" => "dropdown",
"heading" => esc_html__("Testimonials Order", RIT_TEXT_DOMAIN),
"param_name" => "order",
"value" => array(
esc_html__('Random', RIT_TEXT_DOMAIN) => "rand",
esc_html__('Latest', RIT_TEXT_DOMAIN) => "date"
),
"description" => esc_html__("Choose the order of the testimonials.", RIT_TEXT_DOMAIN)
),
array(
"type" => "select-multiple",
"heading" => esc_html__("Testimonials category", RIT_TEXT_DOMAIN),
"param_name" => "category",
"value" => sf_get_category_list('testimonials-category'),
"description" => esc_html__("Choose the category for the testimonials.", RIT_TEXT_DOMAIN)
),
array(
"type" => "dropdown",
"heading" => esc_html__("Pagination", RIT_TEXT_DOMAIN),
"param_name" => "pagination",
"value" => array(esc_html__('No', RIT_TEXT_DOMAIN) => "no", esc_html__('Yes', RIT_TEXT_DOMAIN) => "yes"),
"description" => esc_html__("Show testimonial pagination (1/1 width element only).", RIT_TEXT_DOMAIN)
),
array(
"type" => "dropdown",
"heading" => esc_html__("Testimonials page link", RIT_TEXT_DOMAIN),
"param_name" => "page_link",
"value" => array(esc_html__('No', RIT_TEXT_DOMAIN) => "no", esc_html__('Yes', RIT_TEXT_DOMAIN) => "yes"),
"description" => esc_html__("Include a link to the testimonials page (which you must choose in the theme options).", RIT_TEXT_DOMAIN)
),
array(
"type" => "textfield",
"heading" => esc_html__("Extra class name", RIT_TEXT_DOMAIN),
"param_name" => "el_class",
"value" => "",
"description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", RIT_TEXT_DOMAIN)
)
)
) );
}
}