File: D:/HostingSpaces/MvAlphen/va-bo.nl/wwwroot/wp-content/plugins/hattan-plugin/modules/VC_Clients.php
<?php
if (!class_exists('VC_Clients')) {
class VC_Clients {
private $shortcode_name = 'studiothemes_clients';
function __construct() {
add_action('admin_init', array($this, 'studiothemes_shortcode_init'));
add_shortcode($this->shortcode_name, array($this, 'studiothemes_shortcode'));
}
function studiothemes_shortcode_init() {
if (function_exists('vc_map')) {
vc_map(array(
"name" => "Clients",
"base" => $this->shortcode_name,
"category" => 'by Studio Themes',
"icon" => "icon-wpb-images-carousel",
"allowed_container_element" => 'vc_row',
"params" => array(
array(
'type' => 'attach_images',
'heading' => __( 'Images', 'hattan-plugin' ),
'param_name' => 'images',
'value' => '',
'description' => __( 'Select images from media library.Shortcode working properly when the pictures are of equal size.', 'hattan-plugin' )
),
array(
"type" => "dropdown",
"holder" => "",
"class" => "",
"heading" => __("Number column rows",'hattan-plugin'),
"param_name" => "number_c",
"value" => array(
"3" => "3",
"4" => "4",
"5" => "5",
"6" => "6"
),
"description" => "",
),
array(
"type" => "dropdown",
"holder" => "",
"class" => "",
"heading" => __("Border",'hattan-plugin'),
"param_name" => "clients_border",
"value" => array(
__( 'Half Border', 'hattan-plugin' ) => "half-border",
__( 'Full Border', 'hattan-plugin' ) => "full-border",
),
"description" => "",
),
)
));
}
}
/*
Shortcode logic how it should be rendered
*/
function studiothemes_shortcode($atts, $content = null) {
$html = $number_c = $clients_border = "";
$args = array(
'images' => '',
'number_c' => '4',
'clients_border' => 'half-border'
);
extract(shortcode_atts($args, $atts));
$images = explode( ',', $images );
$html .= "<ul class=\"tiles tiles-{$number_c} {$clients_border} clearfix\">";
foreach ($images as $image ){
$img_src = "";
if (is_numeric($image)) {
$img_src = wp_get_attachment_url($image);
} else {
$img_src = $image;
}
$html .= "<li><img src=\"{$img_src}\" alt=\"\" /></li>";
}
$html .= "</ul>";
return $html;
}
}
// Finally initialize code
new VC_Clients();
}