protected function content($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'suffix' => '', 'prefix' => '', 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'align' => 'center', 'el_class' => '', 'css' => '', 'style' => '1', 'overlay' => '', 'position' => 'middle'), $atts)); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'banner ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'style' => 'style' . $style, 'overlay' => 'banner-' . $overlay, 'align' => 'banner-' . $align, 'position' => 'position-' . $position); $banner_link = ''; $img_id = preg_replace('/[^\\d]/', '', $image); $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive')); if ($img == null) { $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />'; } $output = $img['thumbnail']; $suffix = $suffix ? '<p class="banner-suffix">' . $suffix . '</p>' : ''; $prefix = $prefix ? '<p class="banner-prefix">' . $prefix . '</p>' : ''; $output .= sprintf('<div class="banner-content">%s<h3 class="banner-title">%s</h3>%s</div>', $suffix, $title, $prefix); if ($link) { $link = vc_build_link($link); $a_href = $link['url']; $a_title = $link['title']; $a_target = $link['target']; $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"'); $banner_link = '<a class="banner-link" ' . implode(' ', $icon_box_link) . '></a>'; } $output .= $banner_link; $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>'; }
/** * Add data to the vcex_gitem_post_video shortcode * * @since 1.4.1 */ function vc_gitem_template_attribute_vcex_post_video($value, $data) { // Extract data extract(array_merge(array('output' => '', 'post' => null, 'data' => ''), $data)); // Get and extract shortcode attributes $atts = array(); parse_str($data, $atts); extract(shortcode_atts(array('post_id' => '', 'css' => ''), $atts)); // Get post id $post_id = !empty($post_id) ? $post_id : $post->ID; // Get video $video = wpex_get_post_video($post_id); $video = $video ? wpex_get_post_video_html($video) : ''; if ($video) { // Custom CSS if ($css) { $css = ' ' . vc_shortcode_custom_css_class($css); } // Generate output $output .= '<div class="vcex-gitem-post-video wpex-clear' . $css . '">'; $output .= $video; $output .= '</div><!-- .vcex-gitem-post-video -->'; // Return output return $output; } }
protected function content($atts, $content = null) { extract(shortcode_atts(array('name' => '', 'image' => '', 'image_size' => 'full', 'agency' => '', 'facebook_link' => '', 'twitter_link' => '', 'dribbble_link' => '', 'linkedin_link' => '', 'el_class' => '', 'css' => ''), $atts)); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'team ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class)); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $img_id = preg_replace('/[^\\d]/', '', $image); $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $image_size, 'class' => 'vc_single_image-img img-responsive team-avatar')); if ($img == null) { $img['thumbnail'] = '<img class="vc_img-placeholder vc_single_image-img team-avatar" src="' . vc_asset_url('vc/no_image.png') . '" />'; } $output = ''; $socials = array('<i class="fa fa-facebook"></i>' => $facebook_link, '<i class="fa fa-twitter"></i>' => $twitter_link, '<i class="fa fa-dribbble"></i>' => $dribbble_link, '<i class="fa fa-linkedin"></i>' => $linkedin_link); if ($name) { $output .= '<div class="' . $elementClass . '">'; $output .= $img['thumbnail']; $output .= '<div class="team-attr">'; $output .= '<h4 class="name">' . $name . '</h4>'; $output .= '<div class="agency">' . $agency . '</div>'; if ($facebook_link || $twitter_link || $dribbble_link || $linkedin_link) { $output .= '<ul class="clearfix">'; foreach ($socials as $key => $value) { if ($value) { $output .= '<li><a href="' . $value . '">' . $key . '</a></li>'; } } $output .= '</ul>'; } $output .= '</div>'; $output .= '</div>'; } return $output; }
protected function content($atts, $content = null) { $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('edo_vertical_menu', $atts) : $atts; $atts = shortcode_atts(array('title' => 'Categories', 'theme' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); ob_start(); ?> <!-- Block vertical-menu --> <div class="<?php echo esc_attr($theme); ?> "> <div class="block block-vertical-menu <?php echo esc_attr($elementClass); ?> "> <div class="vertical-head"> <h5 class="vertical-title"><?php echo $title; ?> </h5> </div> <div class="vertical-menu-content"> <?php wp_nav_menu(array('menu' => 'vertical-menu', 'theme_location' => 'vertical-menu', 'depth' => 2, 'container' => '', 'container_class' => '', 'container_id' => 'vertial-menu', 'menu_class' => 'vertical-menu-list', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker())); ?> </div> </div> </div> <!-- ./Block vertical-menu --> <?php return ob_get_clean(); }
function animate_shortcode($atts, $content = null) { //wp_enqueue_script('ultimate-appear'); //wp_enqueue_script('ultimate-custom'); $output = $animation = $opacity = $opacity_start_effect = $animation_duration = $animation_delay = $animation_iteration_count = $inline_disp = $el_class = ''; $opacity_start_effect_data = ''; extract(shortcode_atts(array("animation" => "none", "opacity" => "set", "opacity_start_effect" => "", "animation_duration" => "3", "animation_delay" => "0", "animation_iteration_count" => "1", "inline_disp" => "", "css" => "", "el_class" => ""), $atts)); $style = $infi = $mobile_opt = $css_class = ''; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css, ' '), "ult_createlink", $atts); $css_class = esc_attr($css_class); $ultimate_animation = get_option('ultimate_animation'); if ($ultimate_animation == "disable") { $mobile_opt = 'ult-no-mobile'; } if ($inline_disp !== '') { $style .= 'display:inline-block;'; } if ($opacity == "set") { $style .= 'opacity:0;'; $el_class .= ' ult-animate-viewport '; $opacity_start_effect_data = 'data-opacity_start_effect="' . $opacity_start_effect . '"'; } $inifinite_arr = array("InfiniteRotate", "InfiniteDangle", "InfiniteSwing", "InfinitePulse", "InfiniteHorizontalShake", "InfiniteBounce", "InfiniteFlash", "InfiniteTADA"); if ($animation_iteration_count == 0 || in_array($animation, $inifinite_arr)) { $animation_iteration_count = 'infinite'; $animation = 'infinite ' . $animation; } $output .= '<div class="ult-animation ' . $el_class . ' ' . $mobile_opt . ' ' . $css_class . '" data-animate="' . $animation . '" data-animation-delay="' . $animation_delay . '" data-animation-duration="' . $animation_duration . '" data-animation-iteration="' . $animation_iteration_count . '" style="' . $style . '" ' . $opacity_start_effect_data . '>'; $output .= do_shortcode($content); $output .= '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('image_gallery' => '', 'image_size' => 'full', 'layout' => '', 'margin_image' => 10, 'gallery_popup' => 'true', 'image_size_popup' => 'full', 'el_class' => '', 'css' => ''), $atts); extract($atts); $gallery_popup = apply_filters('kt_sanitize_boolean', $gallery_popup); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wrapper-gallery-grid ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $image_gallery = $image_gallery ? explode(',', $image_gallery) : array(); $popup = $gallery_popup ? ' popup-gallery' : ''; $lightbox_image = $output = ''; if (count($image_gallery) > 0) { $output .= '<div class="' . esc_attr($elementClass) . '">'; $output .= '<div class="gallery-grid' . $popup . '" data-popup="' . esc_attr($gallery_popup) . '" data-layout="' . esc_attr($layout) . '" data-margin="' . esc_attr($margin_image) . '">'; foreach ($image_gallery as $attach_id) { if ($attach_id > 0) { $image = wp_get_attachment_image_src($attach_id, $image_size); if ($gallery_popup) { $image_popup = wp_get_attachment_image_src($attach_id, $image_size_popup); $lightbox_image = 'data-lightbox="' . $image_popup[0] . '"'; } $output .= '<img src="' . $image[0] . '" alt="" ' . $lightbox_image . ' />'; } } $output .= '</div>'; $output .= '</div>'; } return $output; }
function TS_VCSC_Google_Trends_Function($atts) { global $VISUAL_COMPOSER_EXTENSIONS; ob_start(); wp_enqueue_style('ts-visual-composer-extend-front'); extract(shortcode_atts(array('trend_height' => '400', 'trend_width' => '1024', 'trend_average' => 'false', 'trend_tags' => '', 'trend_geo' => 'US', 'margin_top' => 20, 'margin_bottom' => 20, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts)); //format input $trend_height = (int) $trend_height; $trend_width = (int) $trend_width; $trend_tags = esc_attr($trend_tags); $trend_geo = esc_attr($trend_geo); $Trends_Array = explode(',', $trend_tags); $Trends_Count = count($Trends_Array); $output = ''; if (function_exists('vc_shortcode_custom_css_class')) { $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS-VCSC-Google-Trends', $atts); } else { $css_class = ''; } $output .= '<div id="" class="ts-google-trend ' . $css_class . '" style="width: ' . $trend_width . 'px; height: auto; overflow: hidden; margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">'; if ($trend_average == "true") { $output .= '<script type="text/javascript" src="https://www.google.com/trends/embed.js?hl=en-US&q=' . $trend_tags . '&geo=' . $trend_geo . '&cmpt=q&content=1&cid=TIMESERIES_GRAPH_AVERAGES_CHART&export=5&w=' . $trend_width . '&h=' . $trend_height . '"></script>'; } else { $output .= '<script type="text/javascript" src="https://www.google.com/trends/embed.js?hl=en-US&q=' . $trend_tags . '&geo=' . $trend_geo . '&cmpt=q&content=1&cid=TIMESERIES_GRAPH_0&export=5&w=' . $trend_width . '&h=' . $trend_height . '"></script>'; } $output .= '</div>'; echo $output; $myvariable = ob_get_clean(); return $myvariable; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('mode' => '', 'effect' => '', "speed" => '', "pause" => '', 'autoplay' => '', 'controlnav' => '', 'pagernav' => '', 'customnav' => '', 'slide_count' => 1, 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_services_slider_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } wp_print_scripts('wt-extend-bx-slider'); wp_enqueue_style('wt-extend-bx-slider'); $output = ''; $autoplay !== "true" ? $autoplay = 'false' : ''; $controlnav !== "true" ? $controlnav = 'false' : ''; $pagernav !== "true" ? $pagernav = 'false' : ''; $customnav !== "true" ? $customnav = 'false' : ''; $pagernav == "true" && $customnav == "true" ? $bxCustomNav = ' data-bxCustomNav="wt_bxNav_' . $id . '"' : ($bxCustomNav = ''); $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $output .= '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; if ($pagernav == "true" && $customnav == "true") { $output .= "\n\t\t\t" . '<div id="wt_bxNav_' . $id . '" class="wt_bxslider_nav wt_services_buttons">'; for ($i = 1; $i <= $slide_count; $i++) { $icon = ''; $current = $i - 1; isset($atts["icon_" . $i]) && $atts["icon_" . $i] != "" ? $icon = esc_html($atts["icon_" . $i]) : ''; $output .= '<a data-slide-index="' . $current . '" href="#" class="servicesLink"><i class="' . $icon . '"></i></a>'; } $output .= "\n\t\t\t" . '</div>'; } $speed = (int) $speed; $pause = (int) $pause; $output .= "\n\t\t\t" . '<ul class="wt_bxslider" data-bx-mode="' . $mode . '" data-bx-effect="' . $effect . '" data-bx-speed="' . $speed . '" data-bx-pause="' . $pause . '" data-bx-autoPlay="' . $autoplay . '" data-bx-controlNav="' . $controlnav . '" data-bx-pagerNav="' . $pagernav . '" data-bx-customNav="' . $customnav . '"' . $bxCustomNav . '>'; for ($i = 1; $i <= $slide_count; $i++) { $item_content = ''; isset($atts["content_" . $i]) && $atts["content_" . $i] != "" ? $item_content = $atts["content_" . $i] : ''; if ($item_content != '') { $item_content = wpb_js_remove_wpautop($item_content, true); // fix unclosed/unwanted paragraph tags in $content } isset($atts["target_" . $i]) && $atts["target_" . $i] == "true" ? $target = '_blank' : ($target = '_self'); $output .= "\n\t\t\t\t" . '<li class="item"><div class="wt_services_slider">'; if (isset($atts["name_" . $i]) && $atts["name_" . $i] != "") { $item_name = esc_html($atts["name_" . $i]); if (isset($atts["link_" . $i]) && $atts["link_" . $i] != "") { $output .= "\n\t\t\t\t\t" . '<h3><a href="' . esc_url($atts["link_" . $i]) . '" title="' . $item_name . '" target="' . $target . '">' . $item_name . '</a></h3>'; } else { $output .= "\n\t\t\t\t\t" . '<h3>' . $item_name . '</h3>'; } } $output .= "\n\t\t\t\t\t" . $item_content; $output .= "\t\t\t\t" . '</div></li>'; } $output .= "\n\t\t\t" . '</ul>'; $output .= "\n\t\t\t" . '</div>'; return $output; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('mode' => '', 'effect' => '', "speed" => '', "pause" => '', 'autoplay' => '', 'controlnav' => '', 'pagernav' => '', 'img_size' => 'thumbnail', 'slide_count' => 1, 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_testimonials_slider_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } wp_print_scripts('wt-extend-bx-slider'); wp_enqueue_style('wt-extend-bx-slider'); $output = ''; $autoplay !== "true" ? $autoplay = 'false' : ''; $controlnav !== "true" ? $controlnav = 'false' : ''; $pagernav !== "true" ? $pagernav = 'false' : ''; $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $speed = (int) $speed; $pause = (int) $pause; $img_size = esc_html($img_size); $output .= '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; $output .= "\n\t\t\t" . '<ul class="wt_bxslider" data-bx-mode="' . $mode . '" data-bx-effect="' . $effect . '" data-bx-speed="' . $speed . '" data-bx-pause="' . $pause . '" data-bx-autoPlay="' . $autoplay . '" data-bx-controlNav="' . $controlnav . '" data-bx-pagerNav="' . $pagernav . '">'; for ($i = 1; $i <= $slide_count; $i++) { $item_content = ''; $image = ''; isset($atts["content_" . $i]) && $atts["content_" . $i] != "" ? $item_content = $atts["content_" . $i] : ''; if ($item_content != '') { $item_content = wpb_js_remove_wpautop($item_content, true); // fix unclosed/unwanted paragraph tags in $content } if ($atts["image_" . $i] != NULL) { $image = $atts["image_" . $i]; $img_id = preg_replace('/[^\\d]/', '', $image); $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'wt_testimonial_image')); } else { $image = ''; } isset($atts["target_" . $i]) && $atts["target_" . $i] == "true" ? $target = '_blank' : ($target = '_self'); $output .= "\n\t\t\t\t" . '<li class="item">'; if ($image != '') { $output .= "\n\t\t\t\t\t" . $img['thumbnail']; } $output .= "\n\t\t\t\t\t" . $item_content; if (isset($atts["name_" . $i]) && $atts["name_" . $i] != "") { $item_name = esc_html($atts["name_" . $i]); if (isset($atts["link_" . $i]) && $atts["link_" . $i] != "") { $output .= "\n\t\t\t\t\t" . '<h3><a href="' . esc_url($atts["link_" . $i]) . '" title="' . $item_name . '" target="' . $target . '">' . $item_name . '</a></h3>'; } else { $output .= "\n\t\t\t\t\t" . '<h3>' . $item_name . '</h3>'; } } $output .= "\t\t\t\t" . '</li>'; } $output .= "\n\t\t\t" . '</ul>'; $output .= "\n\t\t\t" . '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('image_gallery' => '', 'fullwidth' => true, 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wrapper-gallery-fullwidth ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $image_gallery = $image_gallery ? explode(',', $image_gallery) : array(); if ($fullwidth == 'true') { $class_fulwidth = ' fullwidth '; } else { $class_fulwidth = ' '; } $output = ''; if (count($image_gallery) > 0) { $output .= '<div class="' . esc_attr($elementClass) . '">'; $output .= '<div class="gallery-fullwidth' . $class_fulwidth . '">'; foreach ($image_gallery as $attach_id) { if ($attach_id > 0) { $image = wp_get_attachment_image_src($attach_id, 'kt_gallery_fullwidth'); $output .= '<img src="' . $image[0] . '" alt="" />'; } } $output .= '</div>'; $output .= '</div>'; } return $output; }
public function buildTemplate($atts, $content) { $output = array(); $inline_css = array(); $main_wrapper_classes = array('vc_cta3'); $container_classes = array(); if (!empty($atts['el_class'])) { $main_wrapper_classes[] = $atts['el_class']; } if (!empty($atts['style'])) { $main_wrapper_classes[] = 'vc_cta3-style-' . $atts['style']; } if (!empty($atts['shape'])) { $main_wrapper_classes[] = 'vc_cta3-shape-' . $atts['shape']; } if (!empty($atts['txt_align'])) { $main_wrapper_classes[] = 'vc_cta3-align-' . $atts['txt_align']; } if (!empty($atts['color']) && !(isset($atts['style']) && 'custom' === $atts['style'])) { $main_wrapper_classes[] = 'vc_cta3-color-' . $atts['color']; } if (isset($atts['style']) && 'custom' === $atts['style']) { if (!empty($atts['custom_background'])) { $inline_css[] = vc_get_css_color('background-color', $atts['custom_background']); } } if (!empty($atts['i_on_border'])) { $main_wrapper_classes[] = 'vc_cta3-icons-on-border'; } if (!empty($atts['i_size'])) { $main_wrapper_classes[] = 'vc_cta3-icon-size-' . $atts['i_size']; } if (!empty($atts['i_background_style'])) { $main_wrapper_classes[] = 'vc_cta3-icons-in-box'; } if (!empty($atts['el_width'])) { $container_classes[] = 'vc_cta3-size-' . $atts['el_width']; } if (!empty($atts['add_icon'])) { $output['icons-' . $atts['add_icon']] = $this->getVcIcon($atts); $main_wrapper_classes[] = 'vc_cta3-icons-' . $atts['add_icon']; } if (!empty($atts['add_button'])) { $output['actions-' . $atts['add_button']] = $this->getButton($atts); $main_wrapper_classes[] = 'vc_cta3-actions-' . $atts['add_button']; } if (!empty($atts['css_animation'])) { $main_wrapper_classes[] = $this->getCSSAnimation($atts['css_animation']); } if (!empty($atts['css'])) { $main_wrapper_classes[] = vc_shortcode_custom_css_class($atts['css']); } $output['content'] = wpb_js_remove_wpautop($content, true); $output['heading1'] = $this->getHeading('h2', $atts); $output['heading2'] = $this->getHeading('h4', $atts); $output['css-class'] = $main_wrapper_classes; $output['container-class'] = $container_classes; $output['inline-css'] = $inline_css; $this->template_vars = $output; }
public function render($atts, $content = null) { $css = ''; extract(shortcode_atts(array('css' => ''), $atts)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css, ' ')); $events = new WP_Query(array('post_type' => 'event', 'posts_per_page' => 4, 'order' => 'ASC', 'orderby' => 'event_when', 'meta_query' => array(array('key' => 'event_when', 'value' => current_time('timestamp'), 'compare' => '>')))); $output = ''; if ($events->have_posts()) { $output .= '<div class="event_list_module ' . $css_class . '">'; $output .= '<ul class="events_list clearfix">'; while ($events->have_posts()) { $events->the_post(); $output .= '<li id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class()) . '">'; $output .= '<div class="event-content">'; $output .= '<div class="event-date_wrapper">'; $output .= '<div class="event_top"></div>'; $output .= '<div class="event-date">'; $output .= date('d', get_post_meta(get_the_ID(), 'event_when', true)); $output .= '<span>' . date('F', get_post_meta(get_the_ID(), 'event_when', true)) . '</span>'; $output .= '<div class="event-date-border"></div>'; $output .= '</div>'; $output .= '</div>'; $output .= '<h5><a href="' . get_the_permalink() . '">' . get_the_title() . '</a></h5>'; $output .= '<cite>' . get_post_meta(get_the_ID(), 'event_where', true) . '</cite>'; $output .= '<a href="' . get_the_permalink() . '" class="button">' . __('More Details', STM_DOMAIN) . '</a>'; $output .= '</div>'; $output .= '</li>'; } $output .= '</ul>'; $output .= '</div>'; } wp_reset_query(); return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('text' => __('This is custom heading', 'js_composer'), 'subtitle' => '', 'backend' => '', 'align' => 'center', 'layout' => '1', 'font_container' => '', 'use_theme_fonts' => 'yes', 'google_fonts' => '', 'font_container_subtitle' => '', 'font_container_backend' => '', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'kt-heading ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'text-' . $align, 'layout' => 'style' . $layout); $output = $style_title_css = $style_backend_css = $style_subtitle_css = ''; $style_title = $this->getCustomStyle($atts); if (!empty($style_title['style'])) { $style_title_css = 'style="' . esc_attr(implode(';', $style_title['style'])) . '"'; } $output_title = '<' . $style_title['data']['values']['tag'] . ' class="kt-heading-title" ' . $style_title_css . ' >' . $text . '</' . $style_title['data']['values']['tag'] . '>'; $output_subtitle = ''; if ($subtitle) { $atts['font_container'] = $atts['font_container_subtitle']; $atts['google_fonts'] = ''; $style_subtitle = $this->getCustomStyle($atts); if (!empty($style_subtitle['style'])) { $style_subtitle_css = 'style="' . esc_attr(implode(';', $style_subtitle['style'])) . '"'; } $output_subtitle = '<div class="kt-heading-subtitle" ' . $style_subtitle_css . '>' . $subtitle . '</div>'; } $output_backend = ''; if ($backend) { $atts['font_container'] = $atts['font_container_backend']; $atts['google_fonts'] = ''; $style_backend = $this->getCustomStyle($atts); if (!empty($style_backend['style'])) { $style_backend_css = 'style="' . esc_attr(implode(';', $style_backend['style'])) . '"'; } $output_backend = '<div class="kt-heading-backend" ' . $style_backend_css . '>' . $backend . '</div>'; } $output .= $output_backend . $output_title . $output_subtitle; $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>'; }
function TS_VCSC_Soundcloud_Function($atts) { global $VISUAL_COMPOSER_EXTENSIONS; ob_start(); wp_enqueue_style('ts-visual-composer-extend-front'); extract(shortcode_atts(array('url' => '', 'iframe' => 'true', 'width' => '100%', 'height' => 166, 'auto_play' => 'false', 'color' => '#ff7700', 'show_user' => 'true', 'show_artwork' => 'true', 'show_playcount' => 'true', 'show_comments' => 'true', 'show_reposts' => 'false', 'hide_related' => 'false', 'sharing' => 'true', 'download' => 'true', 'liking' => 'true', 'buying' => 'true', 'start_track' => 0, 'margin_top' => 0, 'margin_bottom' => 0, 'css' => ''), $atts)); $output = $notice = $visible = ''; if (function_exists('vc_shortcode_custom_css_class')) { $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Soundcloud', $atts); } else { $css_class = ''; } $color = str_replace("#", "", $color); if ($iframe == 'true') { // Use iFrame $path = set_url_scheme('http://w.soundcloud.com/player?url=' . $url . '&color=' . $color . '&auto_play=' . $auto_play . '&hide_related=' . $hide_related . '&show_comments=' . $show_comments . '&show_user='******'&start_track=' . $start_track . '&show_playcount=' . $show_playcount . '&show_artwork=' . $show_artwork . '&buying=' . $buying . '&download=' . $download . '&liking=' . $liking . '&sharing=' . $sharing . '&show_reposts=' . $show_reposts . ''); $output .= '<div class="ts-soundcloud-iframe-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; width: 100%; height: 100%;">'; //$output .= '<iframe style="width: 100%; height: ' . $height . 'px;" width="100%" height="' . $height . '" allowtransparency="true" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=' . $url . '&color=' . $color . '&auto_play=' . $auto_play . '&hide_related=' . $hide_related . '&show_comments=' . $show_comments . '&show_user='******'&start_track=' . $start_track . '&show_playcount=' . $show_playcount . '&show_artwork=' . $show_artwork . '&buying=' . $buying . '&download=' . $download . '&liking=' . $liking . '&sharing=' . $sharing . '&show_reposts=' . $show_reposts . '"></iframe>'; $output .= '<iframe style="width: 100%; height: ' . $height . 'px;" width="100%" height="' . $height . '" allowtransparency="true" scrolling="no" frameborder="no" src="' . $path . '"></iframe>'; $output .= '</div>'; } else { // Use Flash $url = 'https://player.soundcloud.com/player.swf?' . http_build_query($atts); $output .= '<div class="ts-soundcloud-flash-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px; width: 100%; height: 100%;">'; $output .= '<object width="' . $width . '" height="' . $height . '">'; $output .= '<param name="movie" value="' . $url . '"></param>'; $output .= '<param name="allowscriptaccess" value="always"></param>'; $output .= '<embed width="' . $width . '" height="' . $height . '" src="' . $url . '" allowscriptaccess="always" type="application/x-shockwave-flash"></embed>'; $output .= '</object>'; $output .= '</div>'; } echo $output; $myvariable = ob_get_clean(); return $myvariable; }
function TS_VCSC_Background_Function($atts) { global $VISUAL_COMPOSER_EXTENSIONS; ob_start(); wp_enqueue_style('ts-extend-ytplayer'); wp_enqueue_script('ts-extend-ytplayer'); if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") { wp_enqueue_style('ts-visual-composer-extend-front'); wp_enqueue_script('ts-visual-composer-extend-front'); } extract(shortcode_atts(array('video_youtube' => '', 'video_mute' => 'true', 'video_loop' => 'false', 'video_start' => 'false', 'video_stop' => 'true', 'video_controls' => 'true', 'video_raster' => 'false', 'el_id' => '', 'el_class' => '', 'css' => ''), $atts)); if (!empty($el_id)) { $background_id = $el_id; } else { $background_id = 'ts-vcsc-pageback-' . mt_rand(999999, 9999999); } if (function_exists('vc_shortcode_custom_css_class')) { $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, '' . vc_shortcode_custom_css_class($css, ' '), 'TS-VCSC-YouTube-Background', $atts); } else { $css_class = ''; } $output = '<div id="' . $background_id . '" class="ts-pageback-youtube ' . $css_class . ' ' . $el_class . '" data-inline="' . $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode . '" data-video="' . $video_youtube . '" data-controls="' . $video_controls . '" data-start="' . $video_start . '" data-raster="' . $video_raster . '" data-mute="' . $video_mute . '" data-loop="' . $video_loop . '"></div>'; echo $output; $myvariable = ob_get_clean(); return $myvariable; }
public function content($atts, $content = null) { # Atts $defaults = array('display_type' => '', 'el_class' => '', 'css' => ''); $atts = vc_shortcode_attribute_parse($defaults, $atts); extract($atts); # Element Class $class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); $css_class = "lab-vc-social-networks {$css_class}"; $css_class .= " display-type-{$display_type}"; ob_start(); ?> <div class="<?php echo esc_attr($css_class) . vc_shortcode_custom_css_class($css, ' '); ?> "> <?php echo do_shortcode('[lab_social_networks]'); ?> </div> <?php $output = ob_get_clean(); return $output; }
function TS_VCSC_Spacer_Function($atts) { global $VISUAL_COMPOSER_EXTENSIONS; ob_start(); if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") { wp_enqueue_style('ts-visual-composer-extend-front'); } extract(shortcode_atts(array('height' => '10', 'css' => ''), $atts)); $output = $notice = $visible = ''; if (function_exists('vc_shortcode_custom_css_class')) { $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS-VCSC-Spacer', $atts); } else { $css_class = ''; } if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") { $notice .= '<span style="text-align: center; color: #D10000; margin: 0 ; padding: 0; font-weight: bold; vertical-align: middle; line-height: ' . $height . 'px;">TS Spacer / Clear (' . $height . 'px)</span>'; $visible .= 'text-align: center; min-height: 30px; height: ' . absint($height + 10) . 'px; visibility: visible; border-top: 1px solid #ededed; border-bottom: 1px solid #ededed; padding: 5px 0;'; } else { $visible .= 'text-align: center; line-height: ' . absint($height) . 'px; height: ' . absint($height) . 'px;'; } $output = '<div class="ts-spacer clearboth ' . $css_class . '" style="' . $visible . '">' . $notice . '</div>'; echo $output; $myvariable = ob_get_clean(); return $myvariable; }
function TS_VCSC_QRCode_Function($atts) { global $VISUAL_COMPOSER_EXTENSIONS; ob_start(); wp_enqueue_style('ts-visual-composer-extend-front'); wp_enqueue_script('ts-extend-qrcode'); wp_enqueue_script('ts-visual-composer-extend-front'); extract(shortcode_atts(array('render' => 'canvas', 'color' => '#000000', 'responsive' => 'false', 'size_min' => 100, 'size_max' => 400, 'size_r' => 100, 'size_f' => 100, 'value' => '', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts)); if (!empty($el_id)) { $qrcode_id = $el_id; } else { $qrcode_id = 'ts-vcsc-qrcode-' . mt_rand(999999, 9999999); } $output = ''; if ($responsive == "true") { $width = $size_r; $class = "responsive"; } else { $width = $size_f; $class = "fixed"; } if (function_exists('vc_shortcode_custom_css_class')) { $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-qrcode-parent ' . $class . ' ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS-VCSC-QRCode', $atts); } else { $css_class = 'ts-qrcode-parent ' . $class . ' ' . $el_class; } $output .= '<div id="' . $qrcode_id . '" class="' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;" data-responsive="' . $responsive . '" data-qrcode="' . $value . '" data-size="' . $width . '" data-min="' . $size_min . '" data-max="' . $size_max . '" data-color="' . $color . '" data-render="' . $render . '"></div>'; echo $output; $myvariable = ob_get_clean(); return $myvariable; }
function display_ultimate_trends($atts, $content = null) { $width = $height = $graph_type = $graph_type_2 = $search_by = $location_by = $gtrend_query = $gtrend_query_2 = $el_class = ''; $css_design_style = ''; extract(shortcode_atts(array("gtrend_width" => "", "gtrend_height" => "", "graph_type" => "TIMESERIES_GRAPH_0", "graph_type_2" => "", "search_by" => "q", "location_by" => "", "gtrend_query" => "", "gtrend_query_2" => "", "el_class" => "", "css_gtrend_design" => ""), $atts)); $vc_version = defined('WPB_VC_VERSION') ? WPB_VC_VERSION : 0; $is_vc_49_plus = version_compare(4.9, $vc_version, '<=') ? 'ult-adjust-bottom-margin' : ''; $css_design_style = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css_gtrend_design, ' '), "ultimate_google_trends", $atts); $css_design_style = esc_attr($css_design_style); if ($search_by === 'q') { $graph_type_new = $graph_type; $gtrend_query_new = $gtrend_query; } else { $graph_type_new = $graph_type_2; $gtrend_query_new = $gtrend_query_2; } if ($gtrend_width != '') { $width = $gtrend_width; $width = '&w=' . $width; } if ($gtrend_height != '') { $height = $gtrend_height; $height = '&h=' . $height; } $id = uniqid('vc-trends-'); $output = '<div id="' . $id . '" class="ultimate-google-trends ' . $is_vc_49_plus . ' ' . $el_class . ' ' . $css_design_style . '"> <script type="text/javascript" src="//www.google.com/trends/embed.js?hl=en-US&q=' . $gtrend_query_new . '&cmpt=' . $search_by . '&geo=' . $location_by . '&content=1&cid=' . $graph_type_new . '&export=5' . $width . $height . '"></script> </div>'; return $output; }
function cs_shortcode_menu_render($atts) { extract(shortcode_atts(array('title' => '', 'nav_menu' => '', 'el_class' => '', 'menu_align' => 'left', 'menu_line_height' => '80', 'css' => '', 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'padding' => '', 'margin_bottom' => ''), $atts)); ob_start(); global $smof_data; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cs_custom_header_menu' . $el_class . $el_class . vc_shortcode_custom_css_class($css, ' '), 'cs-shortcode-menu', $atts); ?> <div id="menu" class="cs_mega_menu main-menu cs-menu-align-<?php echo $menu_align; ?> cs-menu-line-height-<?php echo $menu_line_height; ?> <?php echo $css_class; ?> "> <div class="main-menu-content cshero-menu-dropdown clearfix nav-menu cshero-mobile"> <?php $menus = wp_get_nav_menus(); if ($nav_menu) { echo '<ul class="cshero-dropdown main-menu">'; wp_nav_menu(array('theme_location' => 'main_navigation', 'menu' => $nav_menu, 'depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s', 'walker' => new HeroMenuWalker())); if (is_active_sidebar('cshero-header-content-widget-1')) { ?> <li> <div class="header-cart-search"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar("Header Content Widget 1")) { } ?> </div> </li> <?php } if (isset($smof_data['enable_hidden_sidebar']) && $smof_data['enable_hidden_sidebar'] && !isMobile()) { ?> <li> <a href="#"><i class="fa fa-navicon cs_open"></i></a> </li> <?php } echo '</ul>'; } elseif (empty($menus)) { echo '<div class="menu-pages">'; wp_nav_menu(array('depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s')); echo '</div>'; } else { echo '<ul class="cshero-dropdown main-menu">'; wp_nav_menu(array('depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s', 'walker' => new HeroMenuWalker())); echo '</ul>'; } ?> </div> </div> <button type="button" class="btn btn-default btn-navbar navbar-toggle" data-toggle="collapse" data-target="#cshero-main-menu-mobile"><i class="fa fa-align-justify"></i></button> <div id="cshero-main-menu-mobile" class="collapse navbar-collapse cshero-mmenu"></div> <?php return ob_get_clean(); }
function vc_theme_vc_row($atts, $content = null) { extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'font_color' => '', 'padding' => '', 'margin_bottom' => '', 'container' => '', 'css' => ''), $atts)); $atts['base'] = ''; wp_enqueue_style('js_composer_front'); wp_enqueue_script('wpb_composer_front_js'); wp_enqueue_style('js_composer_custom_css'); $vc_row = new WPBakeryShortCode_VC_Row($atts); $el_class = $vc_row->getExtraClass($el_class); $output = ''; $css_class = $el_class; $id = sh_set($atts, 'el_id') ? ' id="' . $atts['el_id'] . '"' : ''; if ($css) { $css_class .= vc_shortcode_custom_css_class($css, ' ') . ' '; } $style = $vc_row->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom); //$boxed = sh_set( _WSH()->option(), 'boxed_layout' ); //if( $css_class) exit($css_class); if ($container) { return '<section class="section ' . $css_class . '" ' . $style . $id . ' > <div class="container"> <div class="general-row"> ' . wpb_js_remove_wpautop($content) . ' </div> </div> <div class="clearfix"></div> </section> ' . "\n"; } return '<section class="section ' . $css_class . ' general-row" ' . $style . $id . ' > ' . wpb_js_remove_wpautop($content) . ' <div class="clearfix"></div> </section> ' . "\n"; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'subcontent' => '', 'use_theme_fonts' => 'true', 'font_container' => '', 'google_fonts' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts)); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'flip-box ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation)); $style_title = ''; extract($this->getAttributes($atts)); unset($font_container_data['values']['text_align']); $styles = array(); extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts)); $settings = get_option('wpb_js_google_fonts_subsets'); $subsets = ''; if (is_array($settings) && !empty($settings)) { $subsets = '&subset=' . implode(',', $settings); } if (!empty($google_fonts_data) && isset($google_fonts_data['values']['font_family'])) { wp_enqueue_style('vc_google_fonts_' . vc_build_safe_css_class($google_fonts_data['values']['font_family']), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets); } if (!empty($styles)) { $style_title .= 'style="' . esc_attr(implode(';', $styles)) . '"'; } $box_title = $title ? '<' . $font_container_data['values']['tag'] . ' class="flip-box-before" ' . $style_title . '>' . $title . '</' . $font_container_data['values']['tag'] . '>' : ''; $output = $box_title . '<div class="flip-box-after">' . $subcontent . '</div>'; if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('lastest_deals_sidebar', $atts) : $atts; $atts = shortcode_atts(array('title' => '', 'taxonomy' => '', 'number' => 12, 'autoplay' => "false", 'navigation' => "false", 'slidespeed' => 250, 'loop' => "false", 'items' => 1, 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'latest-deals ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $elementClass = apply_filters('kt_lastest_deals_sidebar_class_container', $elementClass); // Get products on sale $product_ids_on_sale = wc_get_product_ids_on_sale(); $meta_query = WC()->query->get_meta_query(); $args = array('posts_per_page' => $number, 'post_type' => 'product', 'orderby' => 'meta_value_num', 'meta_key' => '_sale_price_dates_to', 'order' => 'DESC', 'no_found_rows' => 1, 'post_status' => 'publish', 'meta_query' => $meta_query, 'post__in' => array_merge(array(0), $product_ids_on_sale)); if ($taxonomy) { $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => explode(",", $taxonomy))); } $q = apply_filters('woocommerce_shortcode_products_query', $args, $atts); $query = new WP_Query($q); global $woocommerce_loop; ob_start(); if ($query->have_posts()) { $data_carousel = array("autoplay" => $autoplay, "navigation" => $navigation, "slidespeed" => $slidespeed, "autoheight" => "false", "loop" => $loop, "dots" => "false", 'nav' => "true", "autoplayTimeout" => 1000, "autoplayHoverPause" => "true", 'items' => 1); add_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4); add_filter('woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2); ?> <div class="<?php echo esc_attr($elementClass); ?> "> <h2 class="latest-deal-title"><?php echo esc_html($title); ?> </h2> <div class="latest-deal-content"> <ul class="product-list owl-carousel" <?php echo _data_carousel($data_carousel); ?> > <?php add_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4); while ($query->have_posts()) { $query->the_post(); wc_get_template_part('content', 'product-sidebar'); } // end of the loop. remove_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4); ?> </ul> </div> </div> <?php remove_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4); remove_filter('woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2); } wp_reset_postdata(); wp_reset_query(); $result = ob_get_contents(); ob_clean(); return $result; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('max_width' => 950, 'css_animation' => '', 'align' => 'center', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cruxstore-wrapper', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'cruxstore-wrapper-' . $align); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '" style="max-width: ' . $max_width . 'px;">' . do_shortcode($content) . '</div>'; }
protected function content($atts, $content = null) { $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('list_product', $atts) : $atts; $atts = shortcode_atts(array('title' => '', 'cat' => 0, 'number' => 4, 'types' => 'sale', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); global $woocommerce_loop; $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'popular-tabs ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); ob_start(); $meta_query = WC()->query->get_meta_query(); $query = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $number, 'meta_query' => $meta_query); global $woocommerce_loop; $woocommerce_loop['columns'] = $number; if ($cat > 0) { $query['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $cat)); } if ($types == 'arrival') { $query['orderby'] = 'date'; $query['order'] = 'DESC'; } if ($types == 'sale') { $product_ids_on_sale = wc_get_product_ids_on_sale(); $query['meta_key'] = 'total_sales'; $query['orderby'] = 'meta_value_num'; $query['post__in'] = array_merge(array(0), $product_ids_on_sale); } if ($types == 'review') { add_filter('posts_clauses', array($this, 'order_by_rating_post_clauses')); } $products = new WP_Query(apply_filters('woocommerce_shortcode_products_query', $query, $atts)); if ($types == 'review') { remove_filter('posts_clauses', array($this, 'order_by_rating_post_clauses')); } if ($products->have_posts()) { ?> <div class="mega-group"> <h4 class="mega-group-header"><span><?php echo esc_html($title); ?> </span></h4> <div class="mega-products"> <?php while ($products->have_posts()) { $products->the_post(); ?> <?php wc_get_template_part('content', 'product-verticalmenu'); ?> <?php } // end of the loop. ?> </div> </div> <?php } return ob_get_clean(); }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('date_coming' => '2016/5/19', 'style_coming' => 'style1', 'use_theme_fonts' => '', 'font_container' => '', 'google_fonts' => '', 'use_theme_fonts_value' => '', 'font_container_value' => '', 'google_fonts_value' => '', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $rand = rand(); $custom_css = $data_animate = $cl_animate = $animate_item = ''; $style_title = ''; extract($this->getAttributes($atts)); unset($font_container_data['values']['text_align']); extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts)); $settings = get_option('wpb_js_google_fonts_subsets'); $subsets = ''; if (is_array($settings) && !empty($settings)) { $subsets = '&subset=' . implode(',', $settings); } if (!empty($google_fonts_data) && isset($google_fonts_data['values']['font_family'])) { wp_enqueue_style('vc_google_fonts_' . vc_build_safe_css_class($google_fonts_data['values']['font_family']), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets); } if (!empty($styles)) { $style_title .= esc_attr(implode(';', $styles)); $custom_css .= '#kt_comming_' . $rand . ' .title{ ' . $style_title . ' }'; } $style_value = ''; $atts['font_container'] = $font_container_value; $atts['google_fonts'] = $google_fonts_value; $atts['use_theme_fonts'] = $use_theme_fonts_value; extract($this->getAttributes($atts)); unset($font_container_data['values']['text_align']); extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts)); $settings = get_option('wpb_js_google_fonts_subsets'); $subsets = ''; if (is_array($settings) && !empty($settings)) { $subsets = '&subset=' . implode(',', $settings); } if (!empty($google_fonts_data) && isset($google_fonts_data['values']['font_family'])) { wp_enqueue_style('vc_google_fonts_' . vc_build_safe_css_class($google_fonts_data['values']['font_family']), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets); } if (!empty($styles)) { $style_value .= esc_attr(implode(';', $styles)); $custom_css .= '#kt_comming_' . $rand . ' .value-time{ ' . $style_value . ' }'; } if ($custom_css) { $custom_css = '<div class="kt_custom_css" data-css="' . esc_attr($custom_css) . '"></div>'; } if ($css_animation != '') { $data_animate = 'data-timeeffect="200" data-animation="' . $css_animation . '"'; $cl_animate = 'animation-effect'; $animate_item = 'animation-effect-item'; } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wrapper-comingsoon clearfix ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'animate' => $cl_animate, 'style' => $style_coming); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $html = '<div class="wrap"><div class="value-time">266</div><div class="title">Days</div></div> <div class="wrap"><div class="value-time">09</div><div class="title">Hours</div></div> <div class="wrap"><div class="value-time">53</div><div class="title">Minutes</div></div> <div class="wrap"><div class="value-time">59</div><div class="title">Seconds</div></div>'; $output = '<div class="' . esc_attr($elementClass) . '" ' . $data_animate . '><div id="kt_comming_' . $rand . '" class="coming-soon ' . $animate_item . '" data-date="' . $date_coming . '">' . $html . '</div>' . $custom_css . '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('product_type' => 'classic', 'product_effect' => '', 'desktop' => 4, 'per_page' => 10, 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'source' => 'all', 'categories' => '', 'products' => '', 'operator' => 'IN', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cruxstore-products', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'product_stype' => 'cruxstore-products-' . $product_type, 'woocommerce' => 'woocommerce columns-' . $desktop); $meta_query = WC()->query->get_meta_query(); if ($source == 'best-sellers') { $meta_key = 'total_sales'; $orderby = 'meta_value_num'; } $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $per_page, 'meta_query' => $meta_query, 'order' => $order, 'orderby' => $orderby, 'meta_key' => $meta_key); if ($source == 'onsale') { $product_ids_on_sale = wc_get_product_ids_on_sale(); $args['post__in'] = array_merge(array(0), $product_ids_on_sale); } elseif ($source == 'featured') { $args['meta_query'][] = array('key' => '_featured', 'value' => 'yes'); } elseif ($source == 'top-rated') { add_filter('posts_clauses', array(__CLASS__, 'order_by_rating_post_clauses')); } elseif ($source == 'categories') { if (!empty($categories)) { $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => array_map('sanitize_title', explode(',', $categories)), 'field' => 'slug', 'operator' => $operator)); } } elseif ($source == 'products') { if (!empty($atts['products'])) { $args['post__in'] = array_map('trim', explode(',', $atts['products'])); } } $output = ''; ob_start(); global $woocommerce_loop; $products = new WP_Query(apply_filters('woocommerce_shortcode_products_query', $args, $atts)); if ($product_type != 'classic') { $product_effect = ''; } $woocommerce_loop['columns'] = $desktop; $woocommerce_loop['type'] = $product_type; $woocommerce_loop['effect'] = $product_effect; if ($products->have_posts()) { woocommerce_product_loop_start(); if ($product_type == 'masonry') { echo '<div class="clearfix product col-sm-3 grid-sizer"></div>'; } while ($products->have_posts()) { $products->the_post(); wc_get_template_part('content', 'product'); } // end of the loop. woocommerce_product_loop_end(); } wp_reset_postdata(); if ($source == 'top-rated') { remove_filter('posts_clauses', array(__CLASS__, 'order_by_rating_post_clauses')); } $output .= ob_get_clean(); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>'; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('icon' => '', 'icon_color' => '', 'icon_size' => 32, 'align' => 'right', 'title' => '', 'text' => '', 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_services_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } $icon_style = ''; // Service Icon Output if ($icon_color != '') { $icon_color = 'color: ' . $icon_color . ';'; } if ($icon_color != '') { $icon_style = ' style="' . $icon_color . '"'; } $icon = esc_html($icon); $title = esc_html($title); //$text = esc_textarea( $text ); if ($icon != '') { $icon_out = '<i class="' . $icon . '"></i>'; $icon_bg_out = '<i class="wt_services_bg_icon ' . $icon . '"></i>'; } else { $icon_out = ''; $icon_bg_out = ''; } if ($title != '') { $title_out = '<h3>' . $title . '</h3>'; } else { $title_out = ''; } if ($text != '') { $text_out = '<h5>' . $text . '</h5>'; } else { $text_out = ''; } $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= ' col-lg-6 col-md-6 col-sm-6 col-xs-12 wt_align_' . $align . ' wt_icon_' . $icon_size; $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $output = '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; if ($icon_out != '') { $output .= "\n\t" . $icon_bg_out; $output .= "\n\t" . '<div class="wt_icon wt_icon_' . $icon_size . '"' . $icon_style . '>'; $output .= "\n\t\t" . $icon_out; $output .= "\n\t" . '</div>'; } $output .= "\n\t" . '<div class="wt_service_details">'; $output .= "\n\t\t" . $title_out; $output .= "\n\t\t" . $text_out; $output .= "\n\t" . '</div>'; $output .= '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('edo_find_store', $atts) : $atts; $atts = shortcode_atts(array('small_title' => '', 'big_title' => '', 'desc' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); ob_start(); ?> <div class="block footer-block-box <?php echo esc_attr($elementClass); ?> "> <div class="block-head"> <div class="block-title"> <div class="block-icon"> <img src="<?php echo esc_url(THEME_URL . 'assets/images/location-icon.png'); ?> " alt="<?php esc_attr_e('store icon', 'edo'); ?> " /> </div> <div class="block-title-text text-sm"><?php echo esc_html($small_title); ?> </div> <div class="block-title-text text-lg"><?php echo esc_html($big_title); ?> </div> </div> </div> <div class="block-inner"> <div class="block-info clearfix"> <?php echo esc_html($desc); ?> </div> <div class="block-input-box box-radius clearfix find-store-form"> <input type="text" class="input-box-text" placeholder="<?php esc_attr_e('Zip code, City, Country', 'edo'); ?> " /> <button id="find-store-button" class="block-button main-bg"><?php esc_html_e('Go', 'edo'); ?> </button> <div class="find-store-messages"></div> </div> </div> </div> <?php return ob_get_clean(); }
public function mailchimp_handler($atts, $content) { $atts = shortcode_atts(array('title' => '', 'style' => '', 'list' => '', 'opt_in' => 'yes', 'text_before' => '', 'text_after' => '', 'layout' => 'one', 'height_desktop' => '', 'height_tablet' => '', 'height_mobile' => '', 'css' => ''), $atts); extract($atts); $elementClass = ''; if (function_exists('vc_shortcode_custom_css_class')) { $elementClass = vc_shortcode_custom_css_class($css, ' '); } $this->uniqeID = 'mailchimp-wrapper-' . uniqid(); $this->atts = $atts; $output = ''; $output .= '<div class="block-newsletter ' . $style . '">'; $output .= '<div class="mailchimp-wrapper ' . esc_attr($elementClass) . '" id="' . esc_attr($this->uniqeID) . '">'; if ($title) { $output .= '<div class="block-heading"><h3>' . $title . '</h3></div>'; } $output .= $text_before ? '<div class="mailchimp-before">' . $text_before . '</div>' : ''; $height_option = ''; if ($height_desktop) { $height_option .= '@media (min-width: 992px) {#' . $this->uniqeID . '{min-height: ' . esc_attr($height_desktop) . 'px;}}'; } if ($height_tablet) { $height_option .= '@media (min-width: 769px) {#' . $this->uniqeID . '{min-height: ' . esc_attr($height_tablet) . 'px;}}'; } if ($height_mobile) { $height_option .= '@media (max-width: 768px) {#' . $this->uniqeID . '{min-height: ' . esc_attr($height_mobile) . 'px;}}'; } if ($height_option) { $height_option = '<style>' . $height_option . '</style>'; } if (isset($this->options['api_key']) && !empty($this->options['api_key'])) { if (!$content) { $content = __('Success! Check your inbox or spam folder for a message containing a confirmation link.', 'kt_mailchimp'); } $output .= '<form class="mailchimp-form clearfix mailchimp-layout-' . esc_attr($layout) . '" action="#" method="post">'; $email = '<input name="email" required="" type="email" placeholder="' . __('E-mail address', 'kt_mailchimp') . '"/>'; $button = '<button class="btn btn-default mailchimp-submit" data-loading="' . __('Loading ...', 'kt_mailchimp') . '" data-text="' . __('OK', 'kt_mailchimp') . '" type="submit">' . __('OK', 'kt_mailchimp') . '</button>'; if ($layout == 'one') { $text_repate = '<div class="input-group">%s<div class="input-group-btn">%s</div></div>'; } else { $text_repate = '<div class="mailchimp-input-email">%s</div><div class="mailchimp-input-button">%s</div>'; } $output .= sprintf($text_repate, $email, $button); $output .= '<input type="hidden" name="action" value="signup"/>'; $output .= '<input type="hidden" name="list_id" value="' . $list . '"/>'; $output .= '<input type="hidden" name="opt_in" value="' . $opt_in . '"/>'; $output .= '<div class="mailchimp-success">' . $content . '</div>'; $output .= '<div class="mailchimp-error"></div>'; $output .= '</form>'; } else { $output .= sprintf("Please enter your mailchimp API key in <a href='%s'>%s</a>", admin_url('options-general.php?page=kt-mailchimp-settings'), __('here', 'kutetheme')); } $output .= $text_after ? '<div class="mailchimp-after">' . $text_after . '</div>' : ''; $output .= '</div><!-- .mailchimp-wrapper -->'; $output .= '</div>'; return $output . $height_option; }