function custompostcat_settings_field($settings, $value)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     $dependency = vc_generate_dependencies_attributes($settings);
     $param_name = isset($settings['param_name']) ? $settings['param_name'] : '';
     $posttype = isset($settings['posttype']) ? $settings['posttype'] : '';
     $posttaxonomy = isset($settings['posttaxonomy']) ? $settings['posttaxonomy'] : '';
     $postsingle = isset($settings['postsingle']) ? $settings['postsingle'] : '';
     $postplural = isset($settings['postplural']) ? $settings['postplural'] : '';
     $postclass = isset($settings['postclass']) ? $settings['postclass'] : '';
     $type = isset($settings['type']) ? $settings['type'] : '';
     $url = $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_PluginPath;
     $output = '';
     $posts_fields = array();
     $categories = '';
     $category_fields = array();
     $categories_count = 0;
     $terms_slugs = array();
     $value_arr = $value;
     if (!is_array($value_arr)) {
         $value_arr = array_map('trim', explode(',', $value_arr));
     }
     if (!empty($settings['posttype'])) {
         $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => $posttype, 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
         $custompost_nocategory_count = 0;
         $custompost_nocategory_name = 'ts-' . $postclass . '-none-applied';
         $custompost_query = new WP_Query($args);
         if ($custompost_query->have_posts()) {
             foreach ($custompost_query->posts as $p) {
                 $categories = TS_VCSC_GetTheCategoryByTax($p->ID, $posttaxonomy);
                 if ($categories && !is_wp_error($categories)) {
                     $category_slugs_arr = array();
                     foreach ($categories as $category) {
                         $category_slugs_arr[] = $category->slug;
                         $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'count' => $category->count);
                         $category_fields[] = $category_data;
                     }
                     $categories_slug_str = join(",", $category_slugs_arr);
                 } else {
                     $custompost_nocategory_count++;
                 }
             }
         }
         wp_reset_postdata();
     }
     $category_fields = array_map("unserialize", array_unique(array_map("serialize", $category_fields)));
     $output .= '<div class="ts-custompost-categories-holder">';
     $output .= '<textarea name="' . $param_name . '" id="' . $param_name . '" class="wpb_vc_param_value ' . $param_name . ' ' . $type . '" style="display: none;">' . $value . '</textarea >';
     $output .= '<select multiple="multiple" name="' . $param_name . '_multiple" id="' . $param_name . '_multiple" data-holder="' . $param_name . '" class="ts-custompost-categories-selector wpb-input wpb-select dropdown ' . $param_name . '_multiple" value=" ' . $value . '" style="margin-bottom: 20px;" data-selectable="' . __("Available Categories:", "ts_visual_composer_extend") . '" data-selection="' . __("Applied Categories:", "ts_visual_composer_extend") . '">';
     if ($custompost_nocategory_count > 0) {
         $output .= '<option id="" class="" name="" data-id="" data-author="" value="ts-' . $postclass . '-none-applied" ' . selected(in_array($custompost_nocategory_name, $value_arr), true, false) . '>' . __("No Category", "ts_visual_composer_extend") . ' (' . $custompost_nocategory_count . ')</option>';
     }
     foreach ($category_fields as $index => $array) {
         $output .= '<option id="" class="" name="" data-id="" data-author="" value="' . $category_fields[$index]['slug'] . '" ' . selected(in_array($category_fields[$index]['slug'], $value_arr), true, false) . '>' . $category_fields[$index]['name'] . ' (' . $category_fields[$index]['count'] . ')</option>';
     }
     $output .= '</select>';
     $output .= '<span style="font-size: 10px; margin-bottom: 20px; width: 100%; display: block; text-align: justify;">' . __("Click on a name in 'Available Categories' to add category to slider; click on a name in 'Applied Categories' to remove from slider.", "ts_visual_composer_extend") . '</span>';
     $output .= '</div>';
     return $output;
 }
 function TS_VCSC_Team_Mates_Slider_Category($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     wp_enqueue_script('ts-extend-hammer');
     wp_enqueue_script('ts-extend-nacho');
     wp_enqueue_style('ts-extend-nacho');
     wp_enqueue_style('ts-extend-owlcarousel2');
     wp_enqueue_script('ts-extend-owlcarousel2');
     wp_enqueue_style('ts-font-ecommerce');
     wp_enqueue_style('ts-font-teammates');
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
         wp_enqueue_style('ts-extend-animations');
         wp_enqueue_style('ts-extend-simptip');
         wp_enqueue_style('ts-visual-composer-extend-front');
         wp_enqueue_script('ts-visual-composer-extend-front');
     }
     extract(shortcode_atts(array('teammatecat' => '', 'style' => 'style1', 'show_image' => 'true', 'image_style' => 'imagestyle1', 'show_grayscale' => 'true', 'grayscale_hover' => 'true', 'show_effects' => 'true', 'show_lightbox' => 'true', 'link_image' => 'false', 'show_title' => 'true', 'show_content' => 'true', 'show_dedicated' => 'false', 'show_download' => 'true', 'show_contact' => 'true', 'show_opening' => 'true', 'show_social' => 'true', 'show_skills' => 'true', 'icon_style' => 'simple', 'icon_color' => '#000000', 'icon_background' => '#f5f5f5', 'icon_frame_color' => '#f5f5f5', 'icon_frame_thick' => 1, 'icon_margin' => 5, 'icon_align' => 'left', 'icon_hover' => '', 'tooltip_style' => '', 'tooltip_position' => 'ts-simptip-position-top', 'teammates_slide' => 1, 'auto_height' => 'true', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_playpause' => 'true', 'show_bar' => 'true', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'show_dots' => 'true', 'page_numbers' => 'false', 'items_loop' => 'false', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $teammate_random = mt_rand(999999, 9999999);
     $animation_css = '';
     $team_tooltipclasses = "ts-simptip-multiline " . $tooltip_style . " " . $tooltip_position;
     // Check for Front End Editor
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $slider_class = 'owl-carousel2-edit';
         $slider_message = '<div class="ts-composer-frontedit-message">' . __('The slider is currently viewed in front-end edit mode; slider features are disabled for performance and compatibility reasons.', "ts_visual_composer_extend") . '</div>';
         $product_style = 'width: ' . 100 / $teammates_slide . '%; height: 100%; float: left; margin: 0; padding: 0;';
         $frontend_edit = 'true';
     } else {
         $slider_class = 'ts-owlslider-parent owl-carousel2';
         $slider_message = '';
         $product_style = '';
         $frontend_edit = 'false';
     }
     if (!empty($el_id)) {
         $teammate_slider_id = $el_id;
     } else {
         $teammate_slider_id = 'ts-vcsc-teammate-slider-' . $teammate_random;
     }
     if (!is_array($teammatecat)) {
         $teammatecat = array_map('trim', explode(',', $teammatecat));
     }
     if (empty($icon_background) || $icon_style == 'simple') {
         $icon_frame_style = '';
     } else {
         $icon_frame_style = 'background: ' . $icon_background . ';';
     }
     if ($icon_frame_thick > 0) {
         $icon_top_adjust = 'top: ' . (10 - $icon_frame_thick) . 'px;';
     } else {
         $icon_top_adjust = '';
     }
     if ($icon_style == 'simple') {
         $icon_frame_border = '';
     } else {
         $icon_frame_border = ' border: ' . $icon_frame_thick . 'px solid ' . $icon_frame_color . ';';
     }
     $icon_horizontal_adjust = '';
     $team_social = '';
     $output = '';
     // Retrieve Teammate Post Main Content
     $teammate_array = array();
     $category_fields = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_team', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $teammate_query = new WP_Query($args);
     if ($teammate_query->have_posts()) {
         foreach ($teammate_query->posts as $p) {
             $categories = TS_VCSC_GetTheCategoryByTax($p->ID, 'ts_team_category');
             if ($categories && !is_wp_error($categories)) {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 foreach ($categories as $category) {
                     if (in_array($category->slug, $teammatecat)) {
                         $arrayMatch++;
                     }
                     $category_slugs_arr[] = $category->slug;
                     $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'number' => $category->term_id);
                     $category_fields[] = $category_data;
                 }
                 $categories_slug_str = join(",", $category_slugs_arr);
             } else {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 if (in_array("ts-teammate-none-applied", $teammatecat)) {
                     $arrayMatch++;
                 }
                 $category_slugs_arr[] = '';
                 $categories_slug_str = join(",", $category_slugs_arr);
             }
             if ($arrayMatch > 0) {
                 $teammate_data = array('author' => $p->post_author, 'name' => $p->post_name, 'title' => $p->post_title, 'id' => $p->ID, 'content' => $p->post_content, 'categories' => $categories_slug_str);
                 $teammate_array[] = $teammate_data;
             }
         }
     }
     wp_reset_postdata();
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-teammates-slider ' . $slider_class . ' ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Team_Mates_Slider_Category', $atts);
     } else {
         $css_class = 'ts-teammates-slider ' . $slider_class . ' ' . $el_class;
     }
     $output .= '<div id="' . $teammate_slider_id . '-container" class="ts-teammates-slider-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
     // Front-Edit Message
     if ($frontend_edit == "true") {
         $output .= $slider_message;
     }
     // Add Progressbar
     if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-progressbar-' . $teammate_random . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
     }
     // Add Navigation Controls
     if ($frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-controls-' . $teammate_random . '" class="ts-owlslider-controls" style="' . ($auto_play == "true" && $show_playpause == "true" || $show_navigation == "true" ? "display: block;" : "display: none;") . '">';
         $output .= '<div id="ts-owlslider-controls-next-' . $teammate_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-next"><span class="ts-ecommerce-arrowright5"></span></div>';
         $output .= '<div id="ts-owlslider-controls-prev-' . $teammate_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-prev"><span class="ts-ecommerce-arrowleft5"></span></div>';
         if ($auto_play == "true" && $show_playpause == "true") {
             $output .= '<div id="ts-owlslider-controls-play-' . $teammate_random . '" class="ts-owlslider-controls-play active"><span class="ts-ecommerce-pause"></span></div>';
         }
         $output .= '</div>';
     }
     // Add Slider
     $output .= '<div id="' . $teammate_slider_id . '" class="' . $css_class . '" data-id="' . $teammate_random . '" data-items="' . $teammates_slide . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-dots="' . $show_dots . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
     // Build Teammate Post Main Content
     foreach ($teammate_array as $index => $array) {
         $Team_Author = $teammate_array[$index]['author'];
         $Team_Name = $teammate_array[$index]['name'];
         $Team_Title = $teammate_array[$index]['title'];
         $Team_ID = $teammate_array[$index]['id'];
         $Team_Content = $teammate_array[$index]['content'];
         $Team_Category = $teammate_array[$index]['categories'];
         $Team_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Team_ID), 'full');
         if ($Team_Image == false) {
             $Team_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
         } else {
             $Team_Image = $Team_Image[0];
         }
         // Retrieve Teammate Post Meta Content
         $custom_fields = get_post_custom($Team_ID);
         $custom_fields_array = array();
         foreach ($custom_fields as $field_key => $field_values) {
             if (!isset($field_values[0])) {
                 continue;
             }
             if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                 continue;
             }
             if (strpos($field_key, 'ts_vcsc_team_') !== false) {
                 $field_key_split = explode("_", $field_key);
                 $field_key_length = count($field_key_split) - 1;
                 $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Team_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                 $custom_fields_array[] = $custom_data;
             }
         }
         foreach ($custom_fields_array as $index => $array) {
             ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
         }
         if (isset($Team_Position)) {
             $Team_Position = $Team_Position;
         } else {
             $Team_Position = '';
         }
         if (isset($Team_Buttonlabel)) {
             $Team_Buttonlabel = $Team_Buttonlabel;
         } else {
             $Team_Buttonlabel = '';
         }
         // Build Dedicated Page Link
         $team_dedicated = '';
         if ($show_dedicated == "true") {
             if (isset($Team_Dedicatedpage) && ($Team_Dedicatedpage != -1 || $Team_Dedicatedpage == "external" && isset($Team_Dedicatedlink))) {
                 if ($Team_Dedicatedpage == "external") {
                     $Team_Dedicatedpage = $Team_Dedicatedlink;
                 } else {
                     $Team_Dedicatedpage = get_page_link($Team_Dedicatedpage);
                 }
                 if (isset($Team_Dedicatedtarget)) {
                     $team_dedicated_target = '_blank';
                 } else {
                     $team_dedicated_target = '_parent';
                 }
                 $team_dedicated .= '<div class="ts-teammate-dedicated">';
                 if (isset($Team_Dedicatedtooltip)) {
                     if (isset($Team_Dedicatedicon) && $Team_Dedicatedicon == "none" || !isset($Team_Dedicatedicon)) {
                         $team_dedicated .= '<a class="ts-teammate-page-link ts-button ' . $Team_Dedicatedtype . ' ' . $team_tooltipclasses . '" data-tstooltip="' . $Team_Dedicatedtooltip . '" href="' . TS_VCSC_makeValidURL($Team_Dedicatedpage) . '" target="' . $team_dedicated_target . '">' . $Team_Dedicatedlabel . '</a>';
                     } else {
                         $team_dedicated .= '<a class="ts-teammate-page-link ts-button ' . $Team_Dedicatedtype . ' ' . $team_tooltipclasses . '" data-tstooltip="' . $Team_Dedicatedtooltip . '" href="' . TS_VCSC_makeValidURL($Team_Dedicatedpage) . '" target="' . $team_dedicated_target . '"><i class="ts-teamicon-' . $Team_Dedicatedicon . ' ts-font-icon ts-teammate-icon" style="' . (isset($Team_Dedicatedcolor) ? "color: " . $Team_Dedicatedcolor . ";" : "") . '"></i> ' . $Team_Dedicatedlabel . '</a>';
                     }
                 } else {
                     if (isset($Team_Dedicatedicon) && $Team_Dedicatedicon == "none" || !isset($Team_Dedicatedicon)) {
                         $team_dedicated .= '<a class="ts-teammate-page-link ts-button ' . $Team_Dedicatedtype . '" href="' . TS_VCSC_makeValidURL($Team_Dedicatedpage) . '" target="' . $team_dedicated_target . '">' . $Team_Dedicatedlabel . '</a>';
                     } else {
                         $team_dedicated .= '<a class="ts-teammate-page-link ts-button ' . $Team_Dedicatedtype . '" href="' . TS_VCSC_makeValidURL($Team_Dedicatedpage) . '" target="' . $team_dedicated_target . '"><i class="ts-teamicon-' . $Team_Dedicatedicon . ' ts-font-icon ts-teammate-icon" style="' . (isset($Team_Dedicatedcolor) ? "color: " . $Team_Dedicatedcolor . ";" : "") . '"></i> ' . $Team_Dedicatedlabel . '</a>';
                     }
                 }
                 $team_dedicated .= '</div>';
                 if (get_option('ts_vcsc_extend_settings_loadForcable', 0) == 0) {
                     wp_enqueue_style('ts-extend-buttons', TS_VCSC_GetResourceURL('css/jquery.buttons.css'), null, false, 'all');
                 }
             }
         } else {
             if ($show_lightbox == "false" && $link_image == "true") {
                 if (isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $Team_Dedicatedpage = get_page_link($Team_Dedicatedpage);
                     if (isset($Team_Dedicatedtarget)) {
                         $team_dedicated_target = '_blank';
                     } else {
                         $team_dedicated_target = '_parent';
                     }
                 }
             }
         }
         // Build Team Contact Information
         $team_contact = '';
         $team_contact_count = 0;
         if ($show_contact == "true") {
             $team_contact .= '<div class="ts-team-contact">';
             if (isset($Team_Email)) {
                 $team_contact_count++;
                 if (isset($Team_Emaillabel)) {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-email3 ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a target="_blank" class="" href="mailto:' . $Team_Email . '">' . $Team_Emaillabel . '</a></div>';
                 } else {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-email3 ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a target="_blank" class="" href="mailto:' . $Team_Email . '">' . $Team_Email . '</a></div>';
                 }
             }
             if (isset($Team_Phone)) {
                 $team_contact_count++;
                 $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-phone2 ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i>' . $Team_Phone . '</div>';
             }
             if (isset($Team_Cell)) {
                 $team_contact_count++;
                 $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-mobile ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i>' . $Team_Cell . '</div>';
             }
             if (isset($Team_Portfolio)) {
                 $team_contact_count++;
                 if (isset($Team_Portfoliolabel)) {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-portfolio ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a style="" target="_blank" class="" href="' . TS_VCSC_makeValidURL($Team_Portfolio) . '">' . $Team_Portfoliolabel . '</a></div>';
                 } else {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-portfolio ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a style="" target="_blank" class="" href="' . TS_VCSC_makeValidURL($Team_Portfolio) . '">' . TS_VCSC_makeValidURL($Team_Portfolio) . '</a></div>';
                 }
             }
             if (isset($Team_Other)) {
                 $team_contact_count++;
                 if (isset($Team_Otherlabel)) {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-link ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a style="" target="_blank" class="" href="' . TS_VCSC_makeValidURL($Team_Other) . '">' . $Team_Otherlabel . '</a></div>';
                 } else {
                     $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-link ts-font-icon ts-teammate-icon" style="color: ' . $icon_color . ';"></i><a style="" target="_blank" class="" href="' . TS_VCSC_makeValidURL($Team_Other) . '">' . TS_VCSC_makeValidURL($Team_Other) . '</a></div>';
                 }
             }
             if (isset($Team_Skype)) {
                 $team_contact_count++;
                 $team_contact .= '<div class="ts-contact-parent"><i class="ts-teamicon-skype ts-font-icon ts-teammate-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i>' . $Team_Skype . '</div>';
             }
             $team_contact .= '</div>';
         }
         // Build Opening / Contact Hours
         $team_opening = '';
         $team_opening_count = 0;
         if ($show_opening == "true") {
             $team_opening .= '<div class="ts-team-opening-parent">';
             if (isset($Team_Header)) {
                 if ($Team_Symbol == "none") {
                     $team_opening .= '<div class="ts-team-opening-header">' . $Team_Header . '</div>';
                 } else {
                     $team_opening .= '<div class="ts-team-opening-header"><i class="ts-teamicon-' . $Team_Symbol . ' ts-font-icon ts-teammate-icon" style="' . (isset($Team_Symbolcolor) ? "color: " . $Team_Symbolcolor . ";" : "") . '"></i>' . $Team_Header . '</div>';
                 }
             }
             if (isset($Team_Opening) && $Team_Opening != 'block') {
                 $team_opening_count++;
                 $team_opening .= '<div class="ts-team-opening-block">' . $Team_Opening . '</div>';
             }
             $team_opening .= '</div>';
         }
         // Build Team Social Links
         $team_social = '';
         $team_social_count = 0;
         if ($show_social == "true") {
             $team_social .= '<ul class="ts-teammate-icons ' . $icon_style . ' clearFixMe">';
             if (isset($Team_Facebook)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Facebook"><a style="" target="_blank" class="ts-teammate-link facebook ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Facebook) . '"><i class="ts-teamicon-facebook1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Google)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Google+"><a style="" target="_blank" class="ts-teammate-link gplus ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Google) . '"><i class="ts-teamicon-googleplus1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Twitter)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Twitter"><a style="" target="_blank" class="ts-teammate-link twitter ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Twitter) . '"><i class="ts-teamicon-twitter1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Linkedin)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="LinkedIn"><a style="" target="_blank" class="ts-teammate-link linkedin ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Linkedin) . '"><i class="ts-teamicon-linkedin ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Xing)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Xing"><a style="" target="_blank" class="ts-teammate-link xing ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Xing) . '"><i class="ts-teamicon-xing3 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Envato)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Envato"><a style="" target="_blank" class="ts-teammate-link envato ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Envato) . '"><i class="ts-teamicon-envato ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Rss)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="RSS"><a style="" target="_blank" class="ts-teammate-link rss ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Rss) . '"><i class="ts-teamicon-rss1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Forrst)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Forrst"><a style="" target="_blank" class="ts-teammate-link forrst ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Forrst) . '"><i class="ts-teamicon-forrst1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Flickr)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Flickr"><a style="" target="_blank" class="ts-teammate-link flickr ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Flickr) . '"><i class="ts-teamicon-flickr3 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Instagram)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Instagram"><a style="" target="_blank" class="ts-teammate-link instagram ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Instagram) . '"><i class="ts-teamicon-instagram ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Picasa)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Picasa"><a style="" target="_blank" class="ts-teammate-link picasa ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Picasa) . '"><i class="ts-teamicon-picasa1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Pinterest)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Pinterest"><a style="" target="_blank" class="ts-teammate-link pinterest ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Pinterest) . '"><i class="ts-teamicon-pinterest1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Vimeo)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="Vimeo"><a style="" target="_blank" class="ts-teammate-link vimeo ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Vimeo) . '"><i class="ts-teamicon-vimeo1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             if (isset($Team_Youtube)) {
                 $team_social_count++;
                 $team_social .= '<li class="ts-teammate-icon ' . $icon_align . ' ' . $team_tooltipclasses . '" style="margin: ' . $icon_margin . 'px; ' . $icon_frame_border . ' ' . $icon_frame_style . '" data-tstooltip="YouTube"><a style="" target="_blank" class="ts-teammate-link youtube ' . $icon_hover . '" href="' . TS_VCSC_makeValidURL($Team_Youtube) . '"><i class="ts-teamicon-youtube1 ts-font-icon" style="' . $icon_top_adjust . ' ' . $icon_horizontal_adjust . '"></i></a></li>';
             }
             $team_social .= '</ul>';
         }
         // Build Team Skills
         $team_skills = '';
         $team_skills_count = 0;
         if (isset($Team_Skillset) && $show_skills == "true") {
             $skill_entries = get_post_meta($Team_ID, 'ts_vcsc_team_skills_skillset', true);
             $skill_background = '';
             $team_skills .= '<div class="ts-teammate-member-skills">';
             foreach ((array) $skill_entries as $key => $entry) {
                 $skill_name = $skill_value = $skill_color = '';
                 if (isset($entry['skillname'])) {
                     $skill_name = esc_html($entry['skillname']);
                 }
                 if (isset($entry['skillvalue'])) {
                     $skill_value = esc_html($entry['skillvalue']);
                 }
                 if (isset($entry['skillcolor'])) {
                     $skill_color = esc_html($entry['skillcolor']);
                 }
                 if (strlen($skill_name) != 0 && strlen($skill_value) != 0) {
                     $team_skills_count++;
                     if (strlen($skill_color) != 0 && $skill_color != '#') {
                         $skill_background = 'background-color: ' . $skill_color . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-wrapper clearfix">';
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $skill_name . '<span>(' . $skill_value . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $skill_color . '" data-level="' . $skill_value . '%" style="width: ' . $skill_value . '%; ' . $skill_background . '"></div></div>';
                     $team_skills .= '</div>';
                 }
             }
             $team_skills .= '</div>';
         } else {
             if (!isset($Team_Skillset) && $show_skills == "true") {
                 $skill_background = '';
                 $team_skills .= '<div class="ts-teammate-member-skills">';
                 if (isset($Team_Skillname1) && isset($Team_Skillvalue1)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor1)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor1 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname1 . '<span>(' . $Team_Skillvalue1 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor1 . '" data-level="' . $Team_Skillvalue1 . '%" style="width: ' . $Team_Skillvalue1 . '%; ' . $skill_background . '"></div></div>';
                 }
                 if (isset($Team_Skillname2) && isset($Team_Skillvalue2)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor2)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor2 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname2 . '<span>(' . $Team_Skillvalue2 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor2 . '" data-level="' . $Team_Skillvalue2 . '%" style="width: ' . $Team_Skillvalue2 . '%; ' . $skill_background . '"></div></div>';
                 }
                 if (isset($Team_Skillname3) && isset($Team_Skillvalue3)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor3)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor3 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname3 . '<span>(' . $Team_Skillvalue3 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor3 . '" data-level="' . $Team_Skillvalue3 . '%" style="width: ' . $Team_Skillvalue3 . '%; ' . $skill_background . '"></div></div>';
                 }
                 if (isset($Team_Skillname4) && isset($Team_Skillvalue4)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor4)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor4 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname4 . '<span>(' . $Team_Skillvalue4 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor4 . '" data-level="' . $Team_Skillvalue4 . '%" style="width: ' . $Team_Skillvalue4 . '%; ' . $skill_background . '"></div></div>';
                 }
                 if (isset($Team_Skillname5) && isset($Team_Skillvalue5)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor5)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor5 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname5 . '<span>(' . $Team_Skillvalue5 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor5 . '" data-level="' . $Team_Skillvalue5 . '%" style="width: ' . $Team_Skillvalue5 . '%; ' . $skill_background . '"></div></div>';
                 }
                 if (isset($Team_Skillname6) && isset($Team_Skillvalue6)) {
                     $team_skills_count++;
                     if (isset($Team_Skillcolor6)) {
                         $skill_background = 'background-color: ' . $Team_Skillcolor6 . ';';
                     }
                     $team_skills .= '<div class="ts-skillbars-style1-name">' . $Team_Skillname6 . '<span>(' . $Team_Skillvalue6 . '%)</span></div><div class="ts-skillbars-style1-skillbar"><div class="ts-skillbars-style1-value" data-color="' . $Team_Skillcolor6 . '" data-level="' . $Team_Skillvalue6 . '%" style="width: ' . $Team_Skillvalue6 . '%; ' . $skill_background . '"></div></div>';
                 }
                 $team_skills .= '</div>';
             }
         }
         // Build Download Button
         $team_download = '';
         if ($show_download == "true") {
             if (isset($Team_Buttonfile) || isset($Team_Attachment)) {
                 if (isset($Team_Buttonfile)) {
                     $Team_File = $Team_Buttonfile;
                 } else {
                     $Team_Attachment = get_post_meta($Team_ID, 'ts_vcsc_team_basic_attachment', true);
                     $Team_Attachment = wp_get_attachment_url($Team_Attachment['id']);
                     $Team_File = $Team_Attachment;
                 }
                 $Team_FileFormat = pathinfo($Team_File, PATHINFO_EXTENSION);
                 if (isset($Team_Buttontype)) {
                     $Team_Buttontype = $Team_Buttontype;
                 } else {
                     $Team_Buttontype = 'ts-button-3d';
                 }
                 if (!empty($Team_File)) {
                     $team_download .= '<div class="ts-teammate-download">';
                     if (isset($Team_Buttontooltip)) {
                         if (isset($Team_Buttonicon) && $Team_Buttonicon == "none" || !isset($Team_Buttonicon)) {
                             $team_download .= '<a class="ts-teammate-file-link ts-button ' . $Team_Buttontype . ' ' . $team_tooltipclasses . '" data-format="' . $Team_FileFormat . '" data-tstooltip="' . $Team_Buttontooltip . '" href="' . $Team_File . '" target="_blank">' . $Team_Buttonlabel . '</a>';
                         } else {
                             $team_download .= '<a class="ts-teammate-file-link ts-button ' . $Team_Buttontype . ' ' . $team_tooltipclasses . '" data-format="' . $Team_FileFormat . '" data-tstooltip="' . $Team_Buttontooltip . '" href="' . $Team_File . '" target="_blank"><i class="ts-teamicon-' . $Team_Buttonicon . ' ts-font-icon ts-teammate-icon" style="' . (isset($Team_Buttoncolor) ? "color: " . $Team_Buttoncolor . ":" : "") . '"></i> ' . $Team_Buttonlabel . '</a>';
                         }
                     } else {
                         if (isset($Team_Buttonicon) && $Team_Buttonicon == "none" || !isset($Team_Buttonicon)) {
                             $team_download .= '<a class="ts-teammate-file-link ts-button ' . $Team_Buttontype . '" data-format="' . $Team_FileFormat . '" href="' . $Team_File . '" target="_blank">' . $Team_Buttonlabel . '</a>';
                         } else {
                             $team_download .= '<a class="ts-teammate-file-link ts-button ' . $Team_Buttontype . '" data-format="' . $Team_FileFormat . '" href="' . $Team_File . '" target="_blank"><i class="ts-teamicon-' . $Team_Buttonicon . ' ts-font-icon ts-teammate-icon" style="' . (isset($Team_Buttoncolor) ? "color: " . $Team_Buttoncolor . ";" : "") . '"></i> ' . $Team_Buttonlabel . '</a>';
                         }
                     }
                     $team_download .= '</div>';
                     if (get_option('ts_vcsc_extend_settings_loadForcable', 0) == 0) {
                         wp_enqueue_style('ts-extend-buttons', TS_VCSC_GetResourceURL('css/jquery.buttons.css'), null, false, 'all');
                     }
                 }
             }
         }
         // Grayscale Class
         if ($show_grayscale == "true" && $grayscale_hover == "true") {
             $grayscale_class = 'ts-grayscale-hover';
         } else {
             if ($show_grayscale == "true" && $grayscale_hover == "false") {
                 $grayscale_class = 'ts-grayscale-default';
             } else {
                 $grayscale_class = 'ts-grayscale-none';
             }
         }
         // Create Output
         if ($style == "style1") {
             $output .= '<div class="ts-team1 ts-teammate ' . $grayscale_class . '" style="width: 95%; margin: 0 auto;">';
             if ($show_image == "true" && !empty($Team_Image)) {
                 $output .= '<div class="team-avatar">';
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '<a class="ts-team-image-link" href="' . $Team_Dedicatedpage . '" target="' . $team_dedicated_target . '">';
                 }
                 $output .= '<img src="' . $Team_Image . '" rel="' . ($show_lightbox == "true" ? "nachoteam" : "") . '" title="' . $Team_Title . ' / ' . $Team_Position . '" alt="" class="' . $image_style . ' ' . ($show_lightbox == "true" ? "nch-lightbox" : "") . ' ' . ($show_grayscale == "true" ? "grayscale" : "") . ' ' . ($show_effects == "true" ? "hovereffect" : "") . '">';
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '</a>';
                 }
                 $output .= '</div>';
             }
             $output .= '<div class="team-user">';
             if (!empty($Team_Title)) {
                 $output .= '<h4 class="team-title">' . $Team_Title . '</h4>';
             }
             if (!empty($Team_Position)) {
                 $output .= '<div class="team-job">' . $Team_Position . '</div>';
             }
             $output .= $team_dedicated;
             $output .= $team_download;
             $output .= '</div>';
             if ($show_content == "true" && !empty($Team_Content)) {
                 $output .= '<div class="team-information">';
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '' . wpb_js_remove_wpautop(do_shortcode($Team_Content), true) . '';
                 } else {
                     $output .= '' . do_shortcode($Team_Content) . '';
                 }
                 $output .= '</div>';
             }
             if ($team_contact_count > 0) {
                 $output .= $team_contact;
             }
             if ($team_social_count > 0) {
                 $output .= $team_social;
             }
             if ($team_opening_count > 0) {
                 $output .= $team_opening;
             }
             if ($team_skills_count > 0) {
                 $output .= $team_skills;
             }
             $output .= '</div>';
         }
         if ($style == "style2") {
             $output .= '<div class="ts-team2 ts-teammate ' . $grayscale_class . '" style="width: 95%; margin: 0 auto;">';
             $output .= '<div style="width: 25%; float: left;">';
             if ($show_image == "true" && !empty($Team_Image)) {
                 $output .= '<div class="ts-team2-header">';
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '<a class="ts-team-image-link" href="' . $Team_Dedicatedpage . '" target="' . $team_dedicated_target . '">';
                 }
                 $output .= '<img src="' . $Team_Image . '" rel="' . ($show_lightbox == "true" ? "nachoteam" : "") . '" title="' . $Team_Title . ' / ' . $Team_Position . '" alt="" class="' . $image_style . ' ' . ($show_lightbox == "true" ? "nch-lightbox" : "") . ' ' . ($show_grayscale == "true" ? "grayscale" : "") . ' ' . ($show_effects == "true" ? "hovereffect" : "") . '">';
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '</a>';
                 }
                 $output .= '</div>';
             }
             if ($team_social_count > 0) {
                 if ($show_image == "true") {
                     $output .= '<div class="ts-team2-footer" style="' . ($show_image == "false" ? "margin-top: 0px;" : "") . '">';
                 } else {
                     $output .= '<div class="ts-team2-footer" style="width: 100%; margin-top: 0px;">';
                 }
                 $output .= $team_social;
                 $output .= '</div>';
             }
             $output .= '</div>';
             if ($show_image == "true" || $team_social_count > 0) {
                 $output .= '<div class="ts-team2-content" style="">';
             } else {
                 $output .= '<div class="ts-team2-content" style="width: 100%; margin-left: 0px;">';
             }
             $output .= '<div class="ts-team2-line"></div>';
             if (!empty($Team_Title)) {
                 $output .= '<h3>' . $Team_Title . '</h3>';
             }
             if (!empty($Team_Position)) {
                 $output .= '<p class="ts-team2-lead">' . $Team_Position . '</p>';
             }
             if ($show_content == "true" && !empty($Team_Content)) {
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '' . wpb_js_remove_wpautop(do_shortcode($Team_Content), true) . '';
                 } else {
                     $output .= '' . do_shortcode($Team_Content) . '';
                 }
             }
             $output .= '</div>';
             $output .= $team_dedicated;
             $output .= $team_download;
             if ($team_contact_count > 0) {
                 $output .= $team_contact;
             }
             if ($team_opening_count > 0) {
                 $output .= $team_opening;
             }
             if ($team_skills_count > 0) {
                 $output .= $team_skills;
             }
             $output .= '</div>';
         }
         if ($style == "style3") {
             $output .= '<div class="ts-team3 ts-teammate ' . $grayscale_class . '" style="width: 95%; margin: 0 auto;">';
             if ($show_image == "true" && !empty($Team_Image)) {
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '<a class="ts-team-image-link" href="' . $Team_Dedicatedpage . '" target="' . $team_dedicated_target . '">';
                 }
                 $output .= '<img class="ts-team3-person-image ' . $image_style . ' ' . ($show_lightbox == "true" ? "nch-lightbox" : "") . ' ' . ($show_grayscale == "true" ? "grayscale" : "") . ' ' . ($show_effects == "true" ? "hovereffect" : "") . '" rel="' . ($show_lightbox == "true" ? "nachoteam" : "") . '" src="' . $Team_Image . '" title="' . $Team_Title . ' / ' . $Team_Position . '" alt="">';
                 if ($show_lightbox == "false" && $link_image == "true" && isset($Team_Dedicatedpage) && $Team_Dedicatedpage != -1) {
                     $output .= '</a>';
                 }
             }
             if (!empty($Team_Title)) {
                 $output .= '<div class="ts-team3-person-name">' . $Team_Title . '</div>';
             }
             if (!empty($Team_Position)) {
                 $output .= '<div class="ts-team3-person-position">' . $Team_Position . '</div>';
             }
             if ($show_content == "true" && !empty($Team_Content)) {
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '<div class="ts-team3-person-description">' . wpb_js_remove_wpautop(do_shortcode($Team_Content), true) . '</div>';
                 } else {
                     $output .= '<div class="ts-team3-person-description">' . do_shortcode($Team_Content) . '</div>';
                 }
             }
             $output .= $team_dedicated;
             $output .= $team_download;
             if ($team_contact_count > 0) {
                 $output .= $team_contact;
             }
             if ($team_social_count > 0) {
                 $output .= $team_social;
             }
             if ($team_opening_count > 0) {
                 $output .= $team_opening;
             }
             if ($team_skills_count > 0) {
                 $output .= $team_skills;
             }
             $output .= '<div class="ts-team3-person-space"></div>';
             $output .= '</div>';
         }
         foreach ($custom_fields_array as $index => $array) {
             unset(${$custom_fields_array[$index]['name']});
         }
         if ($frontend_edit == "true") {
             break;
         }
     }
     $output .= '</div>';
     $output .= '</div>';
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }
 function TS_VCSC_Testimonial_Slider_Category($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     wp_enqueue_style('ts-extend-owlcarousel2');
     wp_enqueue_script('ts-extend-owlcarousel2');
     wp_enqueue_style('ts-font-ecommerce');
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
         wp_enqueue_style('ts-extend-animations');
         wp_enqueue_style('ts-visual-composer-extend-front');
         wp_enqueue_script('ts-visual-composer-extend-front');
     }
     extract(shortcode_atts(array('testimonialcat' => '', 'style' => 'style1', 'show_author' => 'true', 'show_avatar' => 'true', 'testimonials_slide' => 1, 'auto_height' => 'true', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_playpause' => 'true', 'show_bar' => 'true', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'show_dots' => 'true', 'page_numbers' => 'false', 'items_loop' => 'true', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $testimonial_random = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $testimonial_slider_id = $el_id;
     } else {
         $testimonial_slider_id = 'ts-vcsc-testimonial-slider-' . $testimonial_random;
     }
     if (!is_array($testimonialcat)) {
         $testimonialcat = array_map('trim', explode(',', $testimonialcat));
     }
     // Check for Front End Editor
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $slider_class = 'owl-carousel2-edit';
         $slider_message = '<div class="ts-composer-frontedit-message">' . __('The slider is currently viewed in front-end edit mode; slider features are disabled for performance and compatibility reasons.', "ts_visual_composer_extend") . '</div>';
         $testimonial_style = 'width: ' . 100 / $testimonials_slide . '%; height: 100%; float: left; margin: 0; padding: 0;';
         $frontend_edit = 'true';
     } else {
         $slider_class = 'ts-owlslider-parent owl-carousel2';
         $slider_message = '';
         $testimonial_style = '';
         $frontend_edit = 'false';
     }
     $output = '';
     // Retrieve Testimonial Post Main Content
     $testimonial_array = array();
     $category_fields = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_testimonials', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $testimonial_query = new WP_Query($args);
     if ($testimonial_query->have_posts()) {
         foreach ($testimonial_query->posts as $p) {
             $categories = TS_VCSC_GetTheCategoryByTax($p->ID, 'ts_testimonials_category');
             if ($categories && !is_wp_error($categories)) {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 foreach ($categories as $category) {
                     if (in_array($category->slug, $testimonialcat)) {
                         $arrayMatch++;
                     }
                     $category_slugs_arr[] = $category->slug;
                     $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'number' => $category->term_id);
                     $category_fields[] = $category_data;
                 }
                 $categories_slug_str = join(",", $category_slugs_arr);
             } else {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 if (in_array("ts-testimonial-none-applied", $testimonialcat)) {
                     $arrayMatch++;
                 }
                 $category_slugs_arr[] = '';
                 $categories_slug_str = join(",", $category_slugs_arr);
             }
             if ($arrayMatch > 0) {
                 $testimonial_data = array('author' => $p->post_author, 'name' => $p->post_name, 'title' => $p->post_title, 'id' => $p->ID, 'content' => $p->post_content, 'categories' => $categories_slug_str);
                 $testimonial_array[] = $testimonial_data;
             }
         }
     }
     wp_reset_postdata();
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-testimonials-slider ' . $slider_class . ' ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Testimonial_Slider_Category', $atts);
     } else {
         $css_class = 'ts-testimonials-slider ' . $slider_class . ' ' . $el_class;
     }
     $output .= '<div id="' . $testimonial_slider_id . '-container" class="ts-testimonials-slider-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
     // Front-Edit Message
     if ($frontend_edit == "true") {
         $output .= $slider_message;
     }
     // Add Progressbar
     if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-progressbar-' . $testimonial_random . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
     }
     // Add Navigation Controls
     if ($frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-controls-' . $testimonial_random . '" class="ts-owlslider-controls" style="' . ($auto_play == "true" && $show_playpause == "true" || $show_navigation == "true" ? "display: block;" : "display: none;") . '">';
         $output .= '<div id="ts-owlslider-controls-next-' . $testimonial_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-next"><span class="ts-ecommerce-arrowright5"></span></div>';
         $output .= '<div id="ts-owlslider-controls-prev-' . $testimonial_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-prev"><span class="ts-ecommerce-arrowleft5"></span></div>';
         if ($auto_play == "true" && $show_playpause == "true") {
             $output .= '<div id="ts-owlslider-controls-play-' . $testimonial_random . '" class="ts-owlslider-controls-play active"><span class="ts-ecommerce-pause"></span></div>';
         }
         $output .= '</div>';
     }
     // Add Slider
     $output .= '<div id="' . $testimonial_slider_id . '" class="' . $css_class . '" data-id="' . $testimonial_random . '" data-items="' . $testimonials_slide . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-dots="' . $show_dots . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
     // Build Testimonial Post Main Content
     foreach ($testimonial_array as $index => $array) {
         //$Testimonial_Author				= $testimonial_array[$index]['author'];
         //$Testimonial_Name 				= $testimonial_array[$index]['name'];
         $Testimonial_Title = $testimonial_array[$index]['title'];
         $Testimonial_ID = $testimonial_array[$index]['id'];
         $Testimonial_Content = $testimonial_array[$index]['content'];
         //$Testimonial_Category 		= $testimonial_array[$index]['categories'];
         $Testimonial_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Testimonial_ID), 'full');
         if ($Testimonial_Image == false) {
             $Testimonial_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
         } else {
             $Testimonial_Image = $Testimonial_Image[0];
         }
         // Retrieve Testimonial Post Meta Content
         $custom_fields = get_post_custom($Testimonial_ID);
         $custom_fields_array = array();
         foreach ($custom_fields as $field_key => $field_values) {
             if (!isset($field_values[0])) {
                 continue;
             }
             if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                 continue;
             }
             if (strpos($field_key, 'ts_vcsc_testimonial_') !== false) {
                 $field_key_split = explode("_", $field_key);
                 $field_key_length = count($field_key_split) - 1;
                 $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Testimonial_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                 $custom_fields_array[] = $custom_data;
             }
         }
         foreach ($custom_fields_array as $index => $array) {
             ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
         }
         if (isset($Testimonial_Position)) {
             $Testimonial_Position = $Testimonial_Position;
         } else {
             $Testimonial_Position = '';
         }
         if (isset($Testimonial_Author)) {
             $Testimonial_Author = $Testimonial_Author;
         } else {
             $Testimonial_Author = '';
         }
         if ($style == "style1") {
             $output .= '<div class="ts-testimonial-main style1 clearFixMe" style="width: 99%; margin: 0 auto;">';
             $output .= '<div class="ts-testimonial-content">';
             if ($show_avatar == "true" || $show_author == "true") {
                 $output .= '<span class="ts-testimonial-arrow"></span>';
             }
             if (function_exists('wpb_js_remove_wpautop')) {
                 $output .= '' . wpb_js_remove_wpautop(do_shortcode($Testimonial_Content), true) . '';
             } else {
                 $output .= '' . do_shortcode($Testimonial_Content) . '';
             }
             $output .= '</div>';
             if ($show_avatar == "true" || $show_author == "true") {
                 $output .= '<div class="ts-testimonial-user">';
                 if ($show_avatar == "true") {
                     $output .= '<div class="ts-testimonial-user-thumb"><img src="' . $Testimonial_Image . '" alt=""></div>';
                 }
                 if ($show_author == "true") {
                     $output .= '<div class="ts-testimonial-user-name">' . $Testimonial_Author . '</div>';
                     $output .= '<div class="ts-testimonial-user-meta">' . $Testimonial_Position . '</div>';
                 }
                 $output .= '</div>';
             }
             $output .= '</div>';
         }
         if ($style == "style2") {
             $output .= '<div class="ts-testimonial-main style2 clearFixMe" style="width: 99%; margin: 0 auto;">';
             $output .= '<div class="blockquote">';
             $output .= '<span class="leftq quotes"></span>';
             if (function_exists('wpb_js_remove_wpautop')) {
                 $output .= '' . wpb_js_remove_wpautop(do_shortcode($Testimonial_Content), true) . '';
             } else {
                 $output .= '' . do_shortcode($Testimonial_Content) . '';
             }
             $output .= '<span class="rightq quotes"></span>';
             $output .= '</div>';
             if ($show_avatar == "true" || $show_author == "true") {
                 $output .= '<div class="information">';
                 if ($show_avatar == "true") {
                     $output .= '<img src="' . $Testimonial_Image . '" style="width: 150px; height: auto; " width="150" height="auto" />';
                 }
                 if ($show_author == "true") {
                     $output .= '<div class="author" style="' . ($show_avatar == "false" ? "margin-left: 15px;" : "") . '">' . $Testimonial_Author . '</div>';
                     $output .= '<div class="metadata">' . $Testimonial_Position . '</div>';
                 }
                 $output .= '</div>';
             }
             $output .= '</div>';
         }
         if ($style == "style3") {
             $output .= '<div class="ts-testimonial-main style3 clearFixMe" style="width: 99%; margin: 0 auto;">';
             if ($show_avatar == "true") {
                 $output .= '<div class="photo">';
                 $output .= '<img src="' . $Testimonial_Image . '" alt=""/>';
                 $output .= '</div>';
             }
             $output .= '<div class="content" style="' . ($show_avatar == "false" ? "margin-left: 0;" : "") . '">';
             $output .= '<span class="laquo"></span>';
             if (function_exists('wpb_js_remove_wpautop')) {
                 $output .= '' . wpb_js_remove_wpautop(do_shortcode($Testimonial_Content), true) . '';
             } else {
                 $output .= '' . do_shortcode($Testimonial_Content) . '';
             }
             $output .= '<span class="raquo"></span>';
             $output .= '</div>';
             if ($show_author == "true") {
                 $output .= '<div class="sign">';
                 $output .= '<span class="author">' . $Testimonial_Author . '</span>';
                 $output .= '<span class="metadata">' . $Testimonial_Position . '</span>';
                 $output .= '</div>';
             }
             $output .= '</div>';
         }
         if ($style == "style4") {
             $output .= '<div class="ts-testimonial-main style4 clearFixMe" style="width: 99%; margin: 0 auto 32px auto;">';
             if ($show_avatar == "true" || $show_author == "true") {
                 $output .= '<div class="ts-testimonial-author-info clearfix">';
                 if ($show_avatar == "true") {
                     $output .= '<div class="ts-testimonial-author-image">';
                     $output .= '<img src="' . $Testimonial_Image . '" alt="">';
                     $output .= '<span class="ts-testimonial-author-overlay"></span>';
                     $output .= '</div>';
                 }
                 if ($show_author == "true") {
                     $output .= '<span class="ts-testimonial-author-name">' . $Testimonial_Author . '</span>';
                     $output .= '<span class="ts-testimonial-author-position">' . $Testimonial_Position . '</span>';
                 }
                 $output .= '</div>';
             }
             $output .= '<div class="ts-testimonial-statement clearfix">';
             if (function_exists('wpb_js_remove_wpautop')) {
                 $output .= '' . wpb_js_remove_wpautop(do_shortcode($Testimonial_Content), true) . '';
             } else {
                 $output .= '' . do_shortcode($Testimonial_Content) . '';
             }
             $output .= '</div>';
             $output .= '<div class="ts-testimonial-bottom-arrow"></div>';
             $output .= '</div>';
         }
         foreach ($custom_fields_array as $index => $array) {
             unset(${$custom_fields_array[$index]['name']});
         }
         if ($frontend_edit == 'true') {
             break;
         }
     }
     $output .= '</div>';
     $output .= '</div>';
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }
 function TS_VCSC_Logo_Slider_Category($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     wp_enqueue_script('ts-extend-hammer');
     wp_enqueue_script('ts-extend-nacho');
     wp_enqueue_style('ts-extend-nacho');
     wp_enqueue_style('ts-extend-owlcarousel2');
     wp_enqueue_script('ts-extend-owlcarouse2');
     wp_enqueue_style('ts-font-ecommerce');
     wp_enqueue_style('ts-font-teammates');
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
         wp_enqueue_style('ts-extend-simptip');
         wp_enqueue_style('ts-extend-animations');
         wp_enqueue_script('ts-extend-badonkatrunc');
         wp_enqueue_style('ts-visual-composer-extend-front');
         wp_enqueue_script('ts-visual-composer-extend-front');
     }
     extract(shortcode_atts(array('logocat' => '', 'style' => 'style1', 'auto_height' => 'true', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_bar' => 'true', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'show_dots' => 'true', 'page_numbers' => 'false', 'transitions' => 'backSlide', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => ''), $atts));
     $logo_random = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $logo_slider_id = $el_id;
     } else {
         $logo_slider_id = 'ts-vcsc-logo-slider-' . $logo_random;
     }
     if (!is_array($logocat)) {
         $logocat = array_map('trim', explode(',', $logocat));
     }
     $output = '';
     // Retrieve Logo Post Main Content
     $logo_array = array();
     $category_fields = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_logos', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $logo_query = new WP_Query($args);
     if ($logo_query->have_posts()) {
         foreach ($logo_query->posts as $p) {
             $categories = TS_VCSC_GetTheCategoryByTax($p->ID, 'ts_logos_category');
             if ($categories && !is_wp_error($categories)) {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 foreach ($categories as $category) {
                     if (in_array($category->slug, $logocat)) {
                         $arrayMatch++;
                     }
                     $category_slugs_arr[] = $category->slug;
                     $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'number' => $category->term_id);
                     $category_fields[] = $category_data;
                 }
                 $categories_slug_str = join(",", $category_slugs_arr);
             } else {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 if (in_array("ts-logo-none-applied", $logocat)) {
                     $arrayMatch++;
                 }
                 $category_slugs_arr[] = '';
                 $categories_slug_str = join(",", $category_slugs_arr);
             }
             if ($arrayMatch > 0) {
                 $logo_data = array('author' => $p->post_author, 'name' => $p->post_name, 'title' => $p->post_title, 'id' => $p->ID, 'content' => $p->post_content, 'categories' => $categories_slug_str);
                 $logo_array[] = $logo_data;
             }
         }
     }
     wp_reset_postdata();
     $output .= '<div id="' . $logo_slider_id . '" class="ts-logos-slider owl-carousel2" data-id="' . $logo_random . '" data-rtl="' . $page_rtl . '" data-navigation="' . $show_navigation . '" data-dots="' . $show_dots . '" data-transitions="' . $transitions . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '" data-numbers="' . $page_numbers . '">';
     // Build Logo Post Main Content
     foreach ($logo_array as $index => $array) {
         $Logo_Author = $logo_array[$index]['author'];
         $Logo_Name = $logo_array[$index]['name'];
         $Logo_Title = $logo_array[$index]['title'];
         $Logo_ID = $logo_array[$index]['id'];
         $Logo_Content = $logo_array[$index]['content'];
         //$Logo_Category 			= $logo_array[$index]['categories'];
         $Logo_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Logo_ID), 'full');
         if ($Logo_Image == false) {
             $Logo_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
         } else {
             $Logo_Image = $Logo_Image[0];
         }
         // Retrieve Logo Post Meta Content
         $custom_fields = get_post_custom($Logo_ID);
         $custom_fields_array = array();
         foreach ($custom_fields as $field_key => $field_values) {
             if (!isset($field_values[0])) {
                 continue;
             }
             if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                 continue;
             }
             if (strpos($field_key, 'ts_vcsc_logo_') !== false) {
                 $field_key_split = explode("_", $field_key);
                 $field_key_length = count($field_key_split) - 1;
                 $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Logo_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                 $custom_fields_array[] = $custom_data;
             }
         }
         foreach ($custom_fields_array as $index => $array) {
             ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
         }
         if (isset($Logo_Position)) {
             $Logo_Position = $Logo_Position;
         } else {
             $Logo_Position = '';
         }
         if (isset($Logo_Author)) {
             $Logo_Author = $Logo_Author;
         } else {
             $Logo_Author = '';
         }
         if ($style == "style1") {
             $output .= '<div class="ts-logo-main style1 clearFixMe" style="width: 98%; margin: 0 auto;">';
             $output .= '<div class="ts-logo-content">';
             $output .= '<span class="ts-logo-arrow"></span>';
             if (function_exists('wpb_js_remove_wpautop')) {
                 $output .= '' . wpb_js_remove_wpautop(do_shortcode($Logo_Content), true) . '';
             } else {
                 $output .= '' . do_shortcode($Logo_Content) . '';
             }
             $output .= '</div>';
             $output .= '<div class="ts-logo-user">';
             $output .= '<div class="ts-logo-user-thumb"><img src="' . $Logo_Image . '" alt=""></div>';
             $output .= '<div class="ts-logo-user-name">' . $Logo_Author . '</div>';
             $output .= '<div class="ts-logo-user-meta">' . $Logo_Position . '</div>';
             $output .= '</div>';
             $output .= '</div>';
         } else {
             if ($style == "style2") {
                 $output .= '<div class="ts-logo-main style2 clearFixMe" style="width: 98%; margin: 0 auto;">';
                 $output .= '<div class="blockquote">';
                 $output .= '<span class="leftq quotes"></span>';
                 if (function_exists('wpb_js_remove_wpautop')) {
                     $output .= '' . wpb_js_remove_wpautop(do_shortcode($Logo_Content), true) . '';
                 } else {
                     $output .= '' . do_shortcode($Logo_Content) . '';
                 }
                 $output .= '<span class="rightq quotes"></span>';
                 $output .= '</div>';
                 $output .= '<div class="information">';
                 $output .= '<img src="' . $Logo_Image . '" width="170" height="auto" />';
                 $output .= '<div class="author">' . $Logo_Author . '</div>';
                 $output .= '<div class="metadata">' . $Logo_Position . '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
             } else {
                 if ($style == "style3") {
                     $output .= '<div class="ts-logo-main style3 clearFixMe" style="width: 98%; margin: 0 auto;">';
                     $output .= '<div class="photo">';
                     $output .= '<img src="' . $Logo_Image . '" alt="" />';
                     $output .= '</div>';
                     $output .= '<div class="content">';
                     $output .= '<span class="laquo"></span>';
                     if (function_exists('wpb_js_remove_wpautop')) {
                         $output .= '' . wpb_js_remove_wpautop(do_shortcode($Logo_Content), true) . '';
                     } else {
                         $output .= '' . do_shortcode($Logo_Content) . '';
                     }
                     $output .= '<span class="raquo"></span>';
                     $output .= '</div>';
                     $output .= '<div class="sign">';
                     $output .= '<span class="author">' . $Logo_Author . '</span>';
                     $output .= '<span class="metadata">' . $Logo_Position . '</span>';
                     $output .= '</div>';
                     $output .= '</div>';
                 }
             }
         }
         foreach ($custom_fields_array as $index => $array) {
             unset(${$custom_fields_array[$index]['name']});
         }
     }
     $output .= '</div>';
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }
 public function form($instance)
 {
     $instance = wp_parse_args((array) $instance, $this->TS_VCSC_Element_Widget_Single_Defaults);
     echo '<div class="ts-vcsc-widget-title-input">';
     echo '<p>';
     echo '<label class="ts-vcsc-widget-label-block" for="' . $this->get_field_id('title') . '">' . __('Title:', 'ts_visual_composer_extend') . '</label>';
     echo '<input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($instance['title']) . '"/>';
     echo '</p>';
     echo '</div>';
     echo '<p class="ts-vcsc-widget-title"><i class="dashicons-index-card" style="font-size: 20px; line-height: 20px; top: 2px;"></i>Widget Item:</p>';
     echo '<p>';
     $posts_count = 0;
     $posts_fields = array();
     $categories = '';
     $category_fields = array();
     $categories_count = 0;
     $terms_slugs = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_widgets', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $widgetpost_nocategory_name = 'ts-widget-none-applied';
     $widgetpost_nocategory = 0;
     $widgetpost_query = new WP_Query($args);
     if ($widgetpost_query->have_posts()) {
         foreach ($widgetpost_query->posts as $p) {
             // Get Categories
             $categories = TS_VCSC_GetTheCategoryByTax($p->ID, 'ts_widgets_category');
             if ($categories && !is_wp_error($categories)) {
                 $category_slugs_arr = array();
                 foreach ($categories as $category) {
                     $category_slugs_arr[] = $category->slug;
                     $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'count' => $category->count);
                     $category_fields[] = $category_data;
                 }
                 $categories_slug_str = join(",", $category_slugs_arr);
             } else {
                 $widgetpost_nocategory++;
                 $categories_slug_str = '';
             }
             // Create Post Data
             $posts_data = array('postid' => $p->ID, 'posttitle' => $p->post_title, 'postdate' => $p->post_date, 'categories' => $categories_slug_str);
             $posts_fields[] = $posts_data;
             $posts_count++;
         }
     }
     wp_reset_postdata();
     $category_fields = array_map("unserialize", array_unique(array_map("serialize", $category_fields)));
     if ($posts_count > 1) {
         echo '<label class="ts-vcsc-widget-label-block" for="ts-vcsc-widget-filter" style="font-weight: normal; font-style: italic;">' . __('Widgets Filter:', 'ts_visual_composer_extend') . '</label>';
         echo '<input class="ts-vcsc-widget-filter" name="ts-vcsc-widget-filter" type="text" value="" style="margin-bottom: 5px;" placeholder="' . __('Enter Keyword to Filter Widgets', 'ts_visual_composer_extend') . '"/>';
     }
     echo '<div class="ts-vcsc-widget-element-select">';
     echo '<label class="ts-vcsc-widget-label-block" for="' . $this->get_field_id('widget') . '">' . __('Select Widget:', 'ts_visual_composer_extend') . '</label>';
     echo '<select id="' . $this->get_field_id('widget') . '" class="ts-vcsc-widget-select-full" name="' . $this->get_field_name('widget') . '">';
     foreach ($posts_fields as $index => $array) {
         echo '<option data-title="' . $posts_fields[$index]['posttitle'] . '" data-id="' . $posts_fields[$index]['postid'] . '" data-categories="' . $posts_fields[$index]['categories'] . '" value="' . $posts_fields[$index]['postid'] . '" ' . selected(esc_attr($instance['widget']), $posts_fields[$index]['postid'], false) . '>' . $posts_fields[$index]['posttitle'] . ' (ID: ' . $posts_fields[$index]['postid'] . ')</option>';
     }
     echo '</select>';
     echo '</div>';
     echo '<span class="ts-vcsc-widget-noresult">No widget items matching your search criteria could be found!</span>';
     echo '<div class="ts-vcsc-widget-title-checkbox">';
     echo '<p>';
     echo '<label class="ts-vcsc-widget-label-inline" for="' . $this->get_field_id('posttitle') . '">Post Title as Widget Title:</label>';
     echo '<input class="checkbox" type="checkbox" value="1" ' . checked('1', esc_attr($instance['posttitle']), false) . ' id="' . $this->get_field_id('posttitle') . '" name="' . $this->get_field_name('posttitle') . '" />';
     echo '</p>';
     echo '</div>';
     echo '</p>';
 }
 function TS_VCSC_Logo_Layouts_Category($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "false") {
         wp_enqueue_style('ts-visual-composer-extend-front');
         wp_enqueue_script('ts-visual-composer-extend-front');
     } else {
         wp_enqueue_style('ts-visual-composer-extend-front');
     }
     extract(shortcode_atts(array('logocat' => '', 'layout' => 'honeycombs', 'target' => '_blank', 'fullwidth' => 'false', 'breakouts' => 6, 'honeycombs_layout' => 'flat', 'honeycombs_breaks' => '1280,960,640', 'honeycombs_sizes' => '340,250,180,100', 'honeycombs_tooltips' => 'true', 'tooltipster_theme' => 'tooltipster-black', 'tooltipster_animation' => 'swing', 'tooltipster_position' => 'top', 'tooltipster_offsetx' => 0, 'tooltipster_offsety' => 0, 'data_grid_breaks' => '240,480,720,960', 'data_grid_width' => 250, 'data_grid_invalid' => 'exclude', 'data_grid_space' => 2, 'data_grid_order' => 'false', 'data_grid_always' => 'false', 'number_images' => 4, 'slide_margin' => 10, 'break_custom' => 'false', 'break_string' => '1,2,3,4,5,6,7,8', 'auto_height' => 'true', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_playpause' => 'true', 'slide_show' => 'false', 'show_bar' => 'true', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'dot_navigation' => 'true', 'page_numbers' => 'false', 'items_loop' => 'false', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'filters_show' => 'false', 'filters_available' => 'Available Groups', 'filters_selected' => 'Filtered Groups', 'filters_nogroups' => 'No Groups', 'filters_toggle' => 'Toggle Filter', 'filters_toggle_style' => '', 'filters_showall' => 'Show All', 'filters_showall_style' => '', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $output = '';
     $modal_gallery = '';
     $logos_random = mt_rand(999999, 9999999);
     if ($logocat == '') {
         exit;
     }
     if (!empty($el_id)) {
         $logos_layout_id = $el_id;
     } else {
         $logos_layout_id = 'ts-vcsc-logos-layout-' . $layout . '-' . $logos_random;
     }
     if (!is_array($logocat)) {
         $logocat = array_map('trim', explode(',', $logocat));
     }
     // Check for Front End Editor
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $frontend_message = '<div class="ts-composer-frontedit-message">' . __('The logos are currently viewed in front-end editor mode; all logo (layout) features are disabled for performance and compatibility reasons.', "ts_visual_composer_extend") . '</div>';
         $frontend_edit = 'true';
     } else {
         $frontend_message = '';
         $frontend_edit = 'false';
     }
     // Retrieve Logo Post Main Content
     $logo_array = array();
     $category_fields = array();
     $args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'post_type' => 'ts_logos', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC');
     $logo_query = new WP_Query($args);
     if ($logo_query->have_posts()) {
         foreach ($logo_query->posts as $p) {
             $categories = TS_VCSC_GetTheCategoryByTax($p->ID, 'ts_logos_category');
             if ($categories && !is_wp_error($categories)) {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 foreach ($categories as $category) {
                     if (in_array($category->slug, $logocat)) {
                         $arrayMatch++;
                     }
                     $category_slugs_arr[] = $category->slug;
                     $category_data = array('slug' => $category->slug, 'name' => $category->cat_name, 'number' => $category->term_id);
                     $category_fields[] = $category_data;
                 }
                 $categories_slug_str = join(",", $category_slugs_arr);
             } else {
                 $category_slugs_arr = array();
                 $arrayMatch = 0;
                 if (in_array("ts-logo-none-applied", $logocat)) {
                     $arrayMatch++;
                 }
                 $category_slugs_arr[] = '';
                 $categories_slug_str = join(",", $category_slugs_arr);
             }
             if ($arrayMatch > 0) {
                 $logo_data = array('name' => $p->post_name, 'title' => $p->post_title, 'id' => $p->ID, 'content' => $p->post_content, 'categories' => $categories_slug_str);
                 $logo_array[] = $logo_data;
             }
         }
     }
     wp_reset_postdata();
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-image-gallery-wrapper ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Logo_Layouts_Category', $atts);
     } else {
         $css_class = 'ts-image-gallery-wrapper ' . $el_class;
     }
     $output .= '<div id="' . $logos_layout_id . '" class="ts-vcsc-logos-layout-wrapper ' . $css_class . '" data-layout="' . $layout . '" style="position: relative; width: 100%; display: block;">';
     // Honeycomb-Grid Layout
     if ($layout == 'honeycombs') {
         wp_enqueue_style('ts-extend-tooltipster');
         wp_enqueue_script('ts-extend-tooltipster');
         if ($filters_show == 'true') {
             if ($filters_toggle_style != '') {
                 wp_enqueue_style('ts-extend-buttonsflat');
             }
             wp_enqueue_style('ts-extend-multiselect');
             wp_enqueue_script('ts-extend-multiselect');
         }
         wp_enqueue_style('ts-extend-honeycombs');
         wp_enqueue_script('ts-extend-honeycombs');
         $fullwidth_allow = "true";
         if ($honeycombs_tooltips == "true") {
             $data_tooltips = 'data-tooltipster-position="' . $tooltipster_position . '" data-tooltipster-touch="false" data-tooltipster-theme="' . $tooltipster_theme . '" data-tooltipster-animation="' . $tooltipster_animation . '" data-tooltipster-arrow="true" data-tooltipster-trigger="hover" data-tooltipster-offsetx="' . $tooltipster_offsetx . '" data-tooltipster-offsety="' . $tooltipster_offsety . '"';
         } else {
             $data_tooltips = '';
         }
         $filter_settings = 'data-gridfilter="' . $filters_show . '" data-gridavailable="' . $filters_available . '" data-gridselected="' . $filters_selected . '" data-gridnogroups="' . $filters_nogroups . '" data-gridtoggle="' . $filters_toggle . '" data-gridtogglestyle="' . $filters_toggle_style . '" data-gridshowall="' . $filters_showall . '" data-gridshowallstyle="' . $filters_showall_style . '"';
         $output .= '<div id="ts-honeycombs-gallery-wrapper-' . $logos_random . '" class="ts-honeycombs-gallery-wrapper" data-inline="' . $frontend_edit . '" data-currentsize="full" data-layout="' . $honeycombs_layout . '" data-tooltips="' . $honeycombs_tooltips . '" ' . $data_tooltips . ' data-fullwidth="' . $fullwidth . '" data-break-parents="' . $breakouts . '" data-breakpoints="' . $honeycombs_breaks . '" data-combsizes="' . $honeycombs_sizes . '" data-margin="' . $data_grid_space . '" data-random="' . $logos_random . '" ' . $filter_settings . '>';
         $output .= '<img id="ts-honeycombs-gallery-loader-' . $logos_random . '" class="ts-honeycombs-gallery-loader" src="' . TS_VCSC_GetResourceURL('images/other/ajax_loader.gif') . '" style="margin: 0 auto;">';
         $output .= '<div class="ts-honeycombs-gallery-inner">';
         // Build Logo Post Main Content
         foreach ($logo_array as $index => $array) {
             $Logo_Name = $logo_array[$index]['name'];
             $Logo_Title = $logo_array[$index]['title'];
             $Logo_ID = $logo_array[$index]['id'];
             $Logo_Content = $logo_array[$index]['content'];
             $Logo_Category = $logo_array[$index]['categories'];
             if ($filters_show == 'true' && isset($Logo_Category)) {
                 $categories = explode(',', $Logo_Category);
                 $Logo_Category = array();
                 foreach ($categories as $category) {
                     $term = get_term_by('slug', $category, 'ts_logos_category');
                     $Logo_Category[] = $term->name;
                 }
                 $Logo_Category = implode(',', $Logo_Category);
             } else {
                 $Logo_Category = '';
             }
             $Logo_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Logo_ID), 'full');
             if ($Logo_Image == false) {
                 $Logo_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
             } else {
                 $Logo_Image = $Logo_Image[0];
             }
             // Retrieve Logo Post Meta Content
             $custom_fields = get_post_custom($Logo_ID);
             $custom_fields_array = array();
             foreach ($custom_fields as $field_key => $field_values) {
                 if (!isset($field_values[0])) {
                     continue;
                 }
                 if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                     continue;
                 }
                 if (strpos($field_key, 'ts_vcsc_logo_') !== false) {
                     $field_key_split = explode("_", $field_key);
                     $field_key_length = count($field_key_split) - 1;
                     $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Logo_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                     $custom_fields_array[] = $custom_data;
                 }
             }
             foreach ($custom_fields_array as $index => $array) {
                 ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
             }
             // Create Tooltip Content
             if (!empty($Logo_Name) && $honeycombs_tooltips == "true") {
                 $thumb_tooltipclasses = 'ts-honeycombs-gallery-tooltip';
                 $thumb_tooltipcontent = 'data-tooltipster-title="" data-tooltipster-text="' . $Logo_Name . '" data-tooltipster-image=""';
             } else {
                 $thumb_tooltipclasses = "";
                 $thumb_tooltipcontent = "";
             }
             // Create Single Logo Output
             if (isset($Logo_Link)) {
                 $Logo_DOM_TAG = 'a';
                 $Logo_DOM_HREF = 'href="' . $Logo_Link . '" target="' . $target . '"';
                 $Logo_DOM_Class = 'ts-honeycombs-gallery-link';
             } else {
                 $Logo_DOM_TAG = 'div';
                 $Logo_DOM_HREF = '';
                 $Logo_DOM_Class = 'ts-honeycombs-gallery-none';
             }
             $output .= '<' . $Logo_DOM_TAG . ' id="" ' . $Logo_DOM_HREF . ' data-thumbnail="' . $Logo_Image . '" data-showing="true" data-groups="All,' . (isset($Logo_Category) ? str_replace('/', ',', $Logo_Category) : "") . '" data-title="' . (!empty($Logo_Name) ? $Logo_Name : "") . '" class="ts-honeycombs-gallery-comb ts-honeycombs-gallery-active ' . $thumb_tooltipclasses . '" ' . $thumb_tooltipcontent . '>';
             $output .= '<div class="ts-honeycombs-gallery-hex-left">';
             $output .= '<div class="ts-honeycombs-gallery-hex-right">';
             $output .= '<div class="ts-honeycombs-gallery-hex-inner" style="background-image: url(' . $Logo_Image . ');">';
             $output .= '<div class="ts-honeycombs-gallery-overlay ' . $Logo_DOM_Class . '"></div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</' . $Logo_DOM_TAG . '>';
             // Reset Array
             foreach ($custom_fields_array as $index => $array) {
                 unset(${$custom_fields_array[$index]['name']});
             }
         }
         $output .= '</div>';
         $output .= '</div>';
     }
     // Auto-Grid or Freewall-Grid Layout
     if ($layout == 'grid' || $layout == 'freewall') {
         wp_enqueue_script('ts-extend-hammer');
         wp_enqueue_script('ts-extend-nacho');
         wp_enqueue_style('ts-extend-nacho');
         if ($filters_show == 'true') {
             if ($filters_toggle_style != '') {
                 wp_enqueue_style('ts-extend-buttonsflat');
             }
             wp_enqueue_style('ts-extend-multiselect');
             wp_enqueue_script('ts-extend-multiselect');
         }
         $fullwidth_allow = "true";
         $valid_images = 0;
         $b = 0;
         if ($layout == 'grid') {
             $class_name = 'ts-image-link-grid-frame';
             $grid_class = 'ts-image-link-grid';
         } else {
             if ($layout == 'freewall') {
                 wp_enqueue_script('ts-extend-freewall');
                 $class_name = 'ts-image-freewall-grid-frame';
                 $grid_class = 'ts-freewall-link-grid';
             }
         }
         if (!empty($data_grid_breaks)) {
             $data_grid_breaks = str_replace(' ', '', $data_grid_breaks);
             $count_columns = substr_count($data_grid_breaks, ",") + 1;
         } else {
             $count_columns = 0;
         }
         if ($layout == 'freewall') {
             $filter_settings = 'data-gridfilter="' . $filters_show . '" data-gridavailable="' . $filters_available . '" data-gridselected="' . $filters_selected . '" data-gridnogroups="' . $filters_nogroups . '" data-gridtoggle="' . $filters_toggle . '" data-gridtogglestyle="' . $filters_toggle_style . '" data-gridshowall="' . $filters_showall . '" data-gridshowallstyle="' . $filters_showall_style . '"';
             $modal_gallery .= '<div id="ts-lightbox-freewall-grid-' . $logos_random . '-container" class="ts-lightbox-freewall-grid-container" data-random="' . $logos_random . '" data-width="' . $data_grid_width . '" data-gutter="' . $data_grid_space . '" ' . $filter_settings . ' style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
         }
         // Build Logo Post Main Content
         $i = -1;
         foreach ($logo_array as $index => $array) {
             $i++;
             $Logo_Name = $logo_array[$index]['name'];
             $Logo_Title = $logo_array[$index]['title'];
             $Logo_ID = $logo_array[$index]['id'];
             $Logo_Content = $logo_array[$index]['content'];
             $Logo_Category = $logo_array[$index]['categories'];
             if ($filters_show == 'true' && isset($Logo_Category)) {
                 $categories = explode(',', $Logo_Category);
                 $Logo_Category = array();
                 foreach ($categories as $category) {
                     $term = get_term_by('slug', $category, 'ts_logos_category');
                     $Logo_Category[] = $term->name;
                 }
                 $Logo_Category = implode(',', $Logo_Category);
             } else {
                 $Logo_Category = '';
             }
             $Logo_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Logo_ID), 'full');
             if ($Logo_Image == false) {
                 $Logo_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
             } else {
                 $Logo_Image = $Logo_Image[0];
             }
             // Retrieve Logo Post Meta Content
             $custom_fields = get_post_custom($Logo_ID);
             $custom_fields_array = array();
             foreach ($custom_fields as $field_key => $field_values) {
                 if (!isset($field_values[0])) {
                     continue;
                 }
                 if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                     continue;
                 }
                 if (strpos($field_key, 'ts_vcsc_logo_') !== false) {
                     $field_key_split = explode("_", $field_key);
                     $field_key_length = count($field_key_split) - 1;
                     $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Logo_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                     $custom_fields_array[] = $custom_data;
                 }
             }
             foreach ($custom_fields_array as $index => $array) {
                 ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
             }
             // Create Single Logo Output
             if (isset($Logo_Link) || $data_grid_invalid != "exclude") {
                 $valid_images++;
                 if ($layout == 'grid') {
                     $modal_gallery .= '<img id="ts-image-link-picture-' . $logos_random . '-' . $i . '" class="ts-image-link-picture" src="' . $Logo_Image . '" rel="link-group-' . $logos_random . '" data-include="true" data-image="' . ($data_grid_invalid == "lightbox" ? $Logo_Image : '') . '" width="" height="" title="' . (isset($Logo_Name) ? $Logo_Name : "") . '" data-groups="' . (isset($Logo_Category) ? str_replace('/', ',', $Logo_Category) : "") . '" data-target="' . $target . '" data-link="' . (isset($Logo_Link) ? $Logo_Link : "") . '">';
                 } else {
                     if ($layout == 'freewall') {
                         if (isset($Logo_Link)) {
                             $image_link = $Logo_Link;
                             $image_class = '';
                             $image_icon = '';
                         } else {
                             if ($data_grid_invalid == 'lightbox') {
                                 $image_link = $Logo_Image;
                                 $image_class = 'nch-lightbox-media nofancybox no-ajaxy';
                                 $image_icon = 'nchgrid-lightbox';
                             } else {
                                 $image_link = '';
                                 $image_class = '';
                                 $image_icon = '';
                             }
                         }
                         $image_groups = isset($Logo_Category) ? str_replace('/', ',', $Logo_Category) : "";
                         $image_title = isset($Logo_Name) ? $Logo_Name : "";
                         $modal_gallery .= '<div id="ts-lightbox-freewall-item-' . $logos_random . '-' . $i . '-parent" class="ts-lightbox-freewall-item ts-lightbox-freewall-active nchgrid-item nchgrid-tile ' . $image_icon . '" data-fixSize="false" data-target="' . $target . '" data-link="' . $image_link . '" data-showing="true" data-groups="' . $image_groups . '" style="width: ' . $data_grid_width . 'px; margin: 0; padding: 0;">';
                         if ($image_link != '') {
                             $modal_gallery .= '<a id="ts-lightbox-freewall-item-' . $logos_random . '-' . $i . '" class="' . $image_class . '" href="' . $image_link . '" target="' . $target . '" title="' . $image_title . '">';
                         }
                         $modal_gallery .= '<img id="ts-lightbox-freewall-picture-' . $logos_random . '-' . $i . '" class="ts-lightbox-freewall-picture" src="' . $Logo_Image . '" width="100%" height="auto" title="' . $image_title . '">';
                         $modal_gallery .= '<div class="nchgrid-caption"></div>';
                         if ($image_title != '') {
                             $modal_gallery .= '<div class="nchgrid-caption-text ' . ($data_grid_always == 'true' ? 'nchgrid-caption-text-always' : '') . '">' . $image_title . '</div>';
                         }
                         if ($image_link != '') {
                             $modal_gallery .= '</a>';
                         }
                         $modal_gallery .= '</div>';
                     }
                 }
             }
             // Reset Array
             foreach ($custom_fields_array as $index => $array) {
                 unset(${$custom_fields_array[$index]['name']});
             }
         }
         if ($layout == 'freewall') {
             $modal_gallery .= '</div>';
         }
         if ($valid_images < $count_columns) {
             $data_grid_string = explode(',', $data_grid_breaks);
             $data_grid_breaks = array();
             foreach ($data_grid_string as $single_break) {
                 $b++;
                 if ($b <= $valid_images) {
                     array_push($data_grid_breaks, $single_break);
                 } else {
                     break;
                 }
             }
             $data_grid_breaks = implode(",", $data_grid_breaks);
         } else {
             $data_grid_breaks = $data_grid_breaks;
         }
         $output .= '<div id="" class="' . $class_name . ' ' . $grid_class . ' ' . ($fullwidth == "true" && $fullwidth_allow == "true" ? "ts-lightbox-nacho-full-frame" : "") . '" data-random="' . $logos_random . '" data-grid="' . $data_grid_breaks . '" data-margin="' . $data_grid_space . '" data-always="' . $data_grid_always . '" data-order="' . $data_grid_order . '" data-break-parents="' . $breakouts . '" data-inline="' . $frontend_edit . '" data-gridfilter="' . $filters_show . '" data-gridavailable="' . $filters_available . '" data-gridselected="' . $filters_selected . '" data-gridnogroups="' . $filters_nogroups . '" data-gridtoggle="' . $filters_toggle . '" data-gridtogglestyle="' . $filters_toggle_style . '" data-gridshowall="' . $filters_showall . '" data-gridshowallstyle="' . $filters_showall_style . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; position: relative;">';
         if ($layout == 'grid') {
             $output .= '<div id="nch-lb-grid-' . $logos_random . '" class="nch-lb-grid" data-filter="nch-lb-filter-' . $logos_random . '" style="" data-toggle="nch-lb-toggle-' . $logos_random . '" data-random="' . $logos_random . '">';
         }
         $output .= $modal_gallery;
         if ($layout == 'grid') {
             $output .= '</div>';
         }
         $output .= '</div>';
     }
     // OwlSlider Layout
     if ($layout == 'owlslider') {
         wp_enqueue_style('ts-font-ecommerce');
         wp_enqueue_style('ts-extend-animations');
         wp_enqueue_style('ts-extend-nacho');
         wp_enqueue_style('ts-extend-owlcarousel2');
         wp_enqueue_script('ts-extend-owlcarousel2');
         $fullwidth_allow = "true";
         $output .= '<div id="ts-lightbox-gallery-slider-' . $logos_random . '-container" class="ts-lightbox-gallery-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
         // Add Progressbar
         if ($auto_play == "true" && $show_bar == "true") {
             $output .= '<div id="ts-owlslider-progressbar-' . $logos_random . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
         }
         // Add Navigation Controls
         $output .= '<div id="ts-owlslider-controls-' . $logos_random . '" class="ts-owlslider-controls" style="' . ($auto_play == "true" && $show_playpause == "true" || $show_navigation == "true" ? "display: block;" : "display: none;") . '">';
         $output .= '<div id="ts-owlslider-controls-next-' . $logos_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-next" title="Next"><span class="ts-ecommerce-arrowright5"></span></div>';
         $output .= '<div id="ts-owlslider-controls-prev-' . $logos_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-prev" title="Previous"><span class="ts-ecommerce-arrowleft5"></span></div>';
         if ($auto_play == "true" && $show_playpause == "true") {
             $output .= '<div id="ts-owlslider-controls-play-' . $logos_random . '" class="ts-owlslider-controls-play active" title="Play / Pause"><span class="ts-ecommerce-pause"></span></div>';
         }
         $output .= '<div id="ts-owlslider-controls-refresh-' . $logos_random . '" style="display: none;" class="ts-owlslider-controls-refresh" title="Refresh"><span class="ts-ecommerce-cycle"></span></div>';
         $output .= '</div>';
         // Add Slider
         $output .= '<div id="ts-lightbox-gallery-slider-' . $logos_random . '" class="ts-owlslider-parent owl-carousel2 ts-logo-gallery-slider" data-id="' . $logos_random . '" data-items="' . $number_images . '" data-breakpointscustom="' . $break_custom . '" data-breakpointitems="' . $break_string . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-dots="' . $dot_navigation . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '" data-margin="' . $slide_margin . '">';
         // Build Logo Post Main Content
         foreach ($logo_array as $index => $array) {
             $Logo_Name = $logo_array[$index]['name'];
             $Logo_Title = $logo_array[$index]['title'];
             $Logo_ID = $logo_array[$index]['id'];
             $Logo_Content = $logo_array[$index]['content'];
             $Logo_Category = $logo_array[$index]['categories'];
             $Logo_Image = wp_get_attachment_image_src(get_post_thumbnail_id($Logo_ID), 'full');
             if ($Logo_Image == false) {
                 $Logo_Image = TS_VCSC_GetResourceURL('images/defaults/default_person.jpg');
             } else {
                 $Logo_Image = $Logo_Image[0];
             }
             // Retrieve Logo Post Meta Content
             $custom_fields = get_post_custom($Logo_ID);
             $custom_fields_array = array();
             foreach ($custom_fields as $field_key => $field_values) {
                 if (!isset($field_values[0])) {
                     continue;
                 }
                 if (in_array($field_key, array("_edit_lock", "_edit_last"))) {
                     continue;
                 }
                 if (strpos($field_key, 'ts_vcsc_logo_') !== false) {
                     $field_key_split = explode("_", $field_key);
                     $field_key_length = count($field_key_split) - 1;
                     $custom_data = array('group' => $field_key_split[$field_key_length - 1], 'name' => 'Logo_' . ucfirst($field_key_split[$field_key_length]), 'value' => $field_values[0]);
                     $custom_fields_array[] = $custom_data;
                 }
             }
             foreach ($custom_fields_array as $index => $array) {
                 ${$custom_fields_array[$index]['name']} = $custom_fields_array[$index]['value'];
             }
             // Create Single Logo Output
             if (isset($Logo_Link)) {
                 $Logo_DOM_TAG = 'a';
                 $Logo_DOM_HREF = 'href="' . $Logo_Link . '" target="' . $target . '"';
                 $Logo_DOM_Class = 'nch-logo-link';
             } else {
                 $Logo_DOM_TAG = 'div';
                 $Logo_DOM_HREF = '';
                 $Logo_DOM_Class = 'nch-logo-image';
             }
             $output .= '<div id="" class="nchgrid-item nchgrid-tile ' . $Logo_DOM_Class . '" style="">';
             $output .= '<' . $Logo_DOM_TAG . ' id="" ' . $Logo_DOM_HREF . ' class="">';
             $output .= '<img src="' . $Logo_Image . '" style="">';
             $output .= '<div class="nchgrid-caption"></div>';
             if (!empty($Logo_Name)) {
                 $output .= '<div class="nchgrid-caption-text">' . (!empty($Logo_Name) ? $Logo_Name : "") . '</div>';
             }
             $output .= '</' . $Logo_DOM_TAG . '>';
             $output .= '</div>';
             // Reset Array
             foreach ($custom_fields_array as $index => $array) {
                 unset(${$custom_fields_array[$index]['name']});
             }
         }
         $output .= '</div>';
         $output .= '</div>';
     }
     $output .= '</div>';
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }