protected function content($atts, $content = null) { $atts = shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'values' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'image-tooltip', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation)); $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 = ''; $values = (array) vc_param_group_parse_atts($values); $text = ''; $left_text = ''; $left_right = ''; foreach ($values as $key => $data) { $new_line = $data; $new_line['left'] = isset($data['left']) ? $data['left'] : 0; $new_line['top'] = isset($data['top']) ? $data['top'] : 0; $new_line['label'] = isset($data['label']) ? $data['label'] : ''; $new_line['color'] = isset($data['color']) ? $data['color'] : 'default'; $new_line['color'] = isset($data['color']) ? $data['color'] : 'default'; $new_line['content'] = isset($data['content']) ? $data['content'] : ''; $active = $key == 0 ? ' active' : ''; $text .= sprintf('<div class="image-tooltip-item %s" style="top: %s; left: %s;"><div class="image-tooltip-content" data-count="%s" title="%s"></div></div>', 'tooltip-' . $new_line['color'] . $active, $new_line['top'] . '%', $new_line['left'] . '%', $key, $new_line['label']); $tooltip = sprintf('<div class="image-tooltip-element %s" data-count="%s"><h4>%s</h4><div>%s</div></div>', $active, $key, $new_line['label'], $data['content']); if ($new_line['align'] == 'right') { $left_right .= $tooltip; } else { $left_text .= $tooltip; } } $output = sprintf('<div class="row"><div class="image-tooltip-left col-md-4">%s</div><div class="image-tooltip-center col-md-4">%s %s</div><div class="image-tooltip-right col-md-4">%s</div></div>', $left_text, '<div class="image-tooltip-image">' . $img['thumbnail'] . '</div>', '<div class="image-tooltip-text">' . $text . '</div>', $left_right); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
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 = shortcode_atts(array('per_page' => '', 'orderby' => 'name', 'order' => 'ASC', 'ids' => '', 'hide_empty' => 'true', 'columns' => '4', 'parent' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); $atts['number'] = $atts['per_page']; $atts['hide_empty'] = apply_filters('sanitize_boolean', $atts['hide_empty']); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'products-categories-grid ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'woocommerce' => 'woocommerce columns-' . $columns, 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); if (isset($atts['ids'])) { $ids = explode(',', $atts['ids']); $ids = array_map('trim', $ids); } else { $ids = array(); } $hide_empty = $atts['hide_empty'] == true || $atts['hide_empty'] == 1 ? 1 : 0; // get terms and workaround WP bug with parents/pad counts $args = array('orderby' => $atts['orderby'], 'order' => $atts['order'], 'hide_empty' => $hide_empty, 'include' => $ids, 'pad_counts' => true, 'child_of' => $atts['parent']); $product_categories = get_terms('product_cat', $args); if ('' !== $atts['parent']) { $product_categories = wp_list_filter($product_categories, array('parent' => $atts['parent'])); } if ($hide_empty) { foreach ($product_categories as $key => $category) { if ($category->count == 0) { unset($product_categories[$key]); } } } if ($atts['number']) { $product_categories = array_slice($product_categories, 0, $atts['number']); } ob_start(); if ($product_categories) { echo '<div class="row multi-columns-row">'; $bootstrapColumn = round(12 / $columns); foreach ($product_categories as $category) { echo '<div class="col-md-' . $bootstrapColumn . ' col-sm-' . $bootstrapColumn . '">'; wc_get_template('content-product_cat_grid.php', array('category' => $category)); echo '</div>'; } echo '</div>'; } wp_reset_postdata(); $output = ob_get_clean(); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('layout' => '', 'id' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cruxstore-contact-form7', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation)); if ($layout) { $elementClass[] = 'layout' . $layout; } $rand = rand(); $output = do_shortcode('[contact-form-7 id="' . $id . '" ]'); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div id="cruxstore-contact-form7' . $rand . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'per_page' => '', 'orderby' => 'name', 'order' => 'ASC', 'ids' => '', 'categories_style' => 'normal', 'hide_empty' => 'true', 'parent' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); $atts['hide_empty'] = apply_filters('sanitize_boolean', $atts['hide_empty']); $atts['number'] = $atts['per_page']; extract($atts); $output = ''; $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'products-categories-list ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'style' => 'style-' . $categories_style); if (isset($atts['ids'])) { $ids = explode(',', $atts['ids']); $ids = array_map('trim', $ids); } else { $ids = array(); } $hide_empty = $atts['hide_empty'] == true || $atts['hide_empty'] == 1 ? 1 : 0; // get terms and workaround WP bug with parents/pad counts $args = array('orderby' => $atts['orderby'], 'order' => $atts['order'], 'hide_empty' => $hide_empty, 'include' => $ids, 'pad_counts' => true, 'child_of' => $atts['parent']); $product_categories = get_terms('product_cat', $args); if ('' !== $atts['parent']) { $product_categories = wp_list_filter($product_categories, array('parent' => $atts['parent'])); } if ($hide_empty) { foreach ($product_categories as $key => $category) { if ($category->count == 0) { unset($product_categories[$key]); } } } if ($atts['number']) { $product_categories = array_slice($product_categories, 0, $atts['number']); } $output .= sprintf('<h4 class="%s">%s</h4>', 'products-categories-heading', $title); if ($product_categories) { $output .= '<ul>'; foreach ($product_categories as $category) { $output .= sprintf('<li><a href="%s">%s</a></li>', get_term_link($category->slug, 'product_cat'), $category->name); } $output .= '</ul>'; } 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) { extract(shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'background_title_color' => '#ebebeb', '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, 'box-colored ', $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 ($background_title_color) { $styles[] = 'background-color: ' . $background_title_color . ';'; } if (!empty($styles)) { $style_title .= 'style="' . esc_attr(implode(';', $styles)) . '"'; } $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') . '" />'; } 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) . '"'); $title = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $title . '</a>'; $img['thumbnail'] = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $img['thumbnail'] . '</a>'; } $box_title = $title ? '<' . $font_container_data['values']['tag'] . ' class="box-colored-title" ' . $style_title . '>' . $title . '</' . $font_container_data['values']['tag'] . '>' : ''; $output = '<div class="box-colored-image">' . $img['thumbnail'] . '</div>' . $box_title; $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => '', 'type' => 'image', 'image' => '', 'link' => '', 'effect' => '', 'max_width' => 650, 'icon_type' => 'icon', 'iconbox_icon' => 'fa fa-adjust', 'iconbox_image' => '', 'color' => '', 'custom_color' => '', 'size' => 'md', 'align' => 'center', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts); extract($atts); $output = $custom_css = ''; $uniqid = uniqid(); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'lightbox-content', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'text-' . $align); $lightbox_icon = ''; if ($icon_type == 'image') { $img_lightbox_id = preg_replace('/[^\\d]/', '', $iconbox_image); $img_lightbox = wp_get_attachment_image_src($img_lightbox_id, 'full'); if (array($img_lightbox)) { $lightbox_icon = sprintf('<img src="%s" class="img-responsive" alt="" />', $img_lightbox['0']); } } else { $lightbox_class = array('vc_lightbox size-' . $size); if ($color != 'custom') { $lightbox_class[] = 'color-' . $color; $custom_color = cruxstore_color2Hex($color); } $lightbox_style = 'style="color: ' . $custom_color . '"'; $lightbox_icon = sprintf('<span class="%s %s" %s></span>', $iconbox_icon, implode(' ', $lightbox_class), $lightbox_style); } $link_attr = array('href' => '', 'class' => 'lightbox-link lightbox-' . $type); if ($type == 'inline') { $link_attr['href'] = '#lightbox-content' . $uniqid; $output .= sprintf('<div id="%s" class="%s">%s</div>', 'lightbox-content' . $uniqid, 'mfp-hide lightbox-popup-block mfp-with-anim', $content); } elseif ($type == 'iframe') { $link_attr['href'] = $link; } else { $img_lightbox_id = preg_replace('/[^\\d]/', '', $image); $img_lightbox = wp_get_attachment_image_src($img_lightbox_id, 'full'); if (array($img_lightbox)) { $link_attr['href'] = $img_lightbox['0']; } else { $link_attr['href'] = vc_asset_url('vc/no_image.png'); } } $output .= sprintf('<a href="%s" class="%s" data-type="%s" data-effect="%s" data-width="%s">%s</a>', $link_attr['href'], $link_attr['class'], $type, $effect, $max_width, $lightbox_icon); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div id="lightbox-' . $uniqid . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . $custom_css . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('author' => '', 'reverse' => 'false', 'layout' => 1, 'css' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => ''), $atts); extract($atts); $output = ''; $reverse = apply_filters('sanitize_boolean', $reverse); $elementClass = array('extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'reverse' => $reverse ? 'blockquote-reverse' : '', 'layout' => 'layout-' . $layout); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $output .= '<blockquote class="' . esc_attr($elementClass) . '"' . $animation_delay . '>'; $output .= '<p>' . do_shortcode($content) . '</p>'; if ($author) { $output .= '<footer>' . $author . '</footer>'; } $output .= '</blockquote>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('layout' => 'default', 'css_animation' => '', 'type' => 'all', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $output = ''; $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cruxstore-search', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'layout' => 'layout' . $layout); $rand = rand(); $type = $type == 'products' && cruxstore_is_wc() ? 'WC_Widget_Product_Search' : 'WP_Widget_Search'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if (is_object($wp_widget_factory) && isset($wp_widget_factory->widgets, $wp_widget_factory->widgets[$type])) { ob_start(); the_widget($type, $atts, $args); $output .= ob_get_clean(); } else { $output .= $this->debugComment('Widget ' . esc_attr($type) . 'Not found in : vc_wp_search'); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div id="cruxstore-search' . $rand . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('title' => '', "type" => 'normal', "close" => 'false', 'style' => 'classic', 'animation_delay' => '', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts)); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'alert ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'type' => 'alert-' . $type, 'style' => 'alert-style-' . $style, 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'css_animation' => cruxstore_getCSSAnimation($css_animation)); if ($close == 'true') { $elementClass['dismissible'] = 'alert-dismissible fade in'; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $output = ''; $output .= '<div class="' . esc_attr($elementClass) . '" role="alert"' . $animation_delay . '>'; if ($close == 'true') { $output .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times"></i></span></button>'; } if ($title) { $output .= '<h3 class="alert_title">' . $title . '</h3>'; } $output .= $content; $output .= '</div><!-- .alert -->'; return $output; }
protected function content($atts, $content = null) { extract(shortcode_atts(array("social" => '', "size" => 'standard', "style" => 'accent', 'custom_color' => '', 'align' => '', 'tooltip' => 'top', 'background_style' => 'empty', 'space_between_item' => 3, 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts)); $output = $social_icons = ''; $socials_arr = array('facebook' => array('title' => esc_html__('Facebook', 'cruxstore'), 'icon' => 'fa fa-facebook', 'link' => '%s'), 'twitter' => array('title' => esc_html__('Twitter', 'cruxstore'), 'icon' => 'fa fa-twitter', 'link' => 'http://www.twitter.com/%s'), 'dribbble' => array('title' => esc_html__('Dribbble', 'cruxstore'), 'icon' => 'fa fa-dribbble', 'link' => 'http://www.dribbble.com/%s'), 'vimeo' => array('title' => esc_html__('Vimeo', 'cruxstore'), 'icon' => 'fa fa-vimeo-square', 'link' => 'http://www.vimeo.com/%s'), 'tumblr' => array('title' => esc_html__('Tumblr', 'cruxstore'), 'icon' => 'fa fa-tumblr', 'link' => 'http://%s.tumblr.com/'), 'skype' => array('title' => esc_html__('Skype', 'cruxstore'), 'icon' => 'fa fa-skype', 'link' => 'skype:%s'), 'linkedin' => array('title' => esc_html__('LinkedIn', 'cruxstore'), 'icon' => 'fa fa-linkedin', 'link' => '%s'), 'googleplus' => array('title' => esc_html__('Google Plus', 'cruxstore'), 'icon' => 'fa fa-google-plus', 'link' => '%s'), 'youtube' => array('title' => esc_html__('Youtube', 'cruxstore'), 'icon' => 'fa fa-youtube', 'link' => 'http://www.youtube.com/user/%s'), 'pinterest' => array('title' => esc_html__('Pinterest', 'cruxstore'), 'icon' => 'fa fa-pinterest', 'link' => 'http://www.pinterest.com/%s'), 'instagram' => array('title' => esc_html__('Instagram', 'cruxstore'), 'icon' => 'fa fa-instagram', 'link' => 'http://instagram.com/%s'), 'behance' => array('title' => esc_html__('Behance', 'cruxstore'), 'icon' => 'fa fa-behance', 'link' => 'https://www.behance.net/%s')); foreach ($socials_arr as $k => &$v) { $val = cruxstore_option($k); $v['val'] = $val ? $val : ''; } $tooltiphtml = ''; if ($tooltip) { $tooltiphtml .= ' data-toggle="tooltip" data-placement="' . esc_attr($tooltip) . '" '; } $margin = $space_between_item > 0 ? 'style="padding-left:' . $space_between_item . 'px;padding-right:' . $space_between_item . 'px;"' : ''; if ($social) { $social_type = explode(',', $social); foreach ($social_type as $id) { $val = $socials_arr[$id]; if ($val['val']) { $social_text = '<i class="' . esc_attr($val['icon']) . '"></i>'; $social_icons .= '<li ' . $margin . '><a class="' . esc_attr($id) . '" title="' . esc_attr($val['title']) . '" ' . $tooltiphtml . ' href="' . esc_url(str_replace('%s', $val['val'], $val['link'])) . '" target="_blank">' . $social_text . '</a></li>' . "\n"; } } } else { foreach ($socials_arr as $key => $val) { if ($val['val']) { $social_text = '<i class="' . esc_attr($val['icon']) . '"></i>'; $social_icons .= '<li ' . $margin . '><a class="' . esc_attr($key) . '" ' . $tooltiphtml . ' title="' . esc_attr($val['title']) . '" href="' . esc_url(str_replace('%s', $val['val'], $val['link'])) . '" target="_blank">' . $social_text . '</a></li>' . "\n"; } } } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'socials-icon-wrapper', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'style' => 'social-style-' . $style, 'size' => 'social-icons-' . $size, 'shape' => 'social-background-' . $background_style, 'clearfix' => 'clearfix', 'css_animation' => cruxstore_getCSSAnimation($css_animation)); if ($background_style == 'empty') { $elementClass[] = 'social-background-empty'; } elseif (strpos($background_style, 'outline') !== false) { $elementClass[] = 'social-background-outline'; } else { $elementClass[] = 'social-background-fill'; } $custom_css = ''; $rand = 'cruxstore_social_' . rand(); if ($style == 'custom') { $custom_css .= '#' . $rand . '.social-style-custom.social-background-fill a{ color:#fff!important; background:' . $custom_color . '!important; }'; $custom_css .= '#' . $rand . '.social-style-custom.social-background-outline a{ color:' . $custom_color . '!important; border-color:' . $custom_color . '!important; background: none !important; }'; $custom_css .= '#' . $rand . '.social-style-custom.social-background-empty a{ color:' . $custom_color . '!important; background:none!important; border:!important; }'; } if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></div>'; } if ($align) { $elementClass['align'] = 'social-icons-' . $align; } if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output .= '<div id="' . $rand . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '><ul style="margin-left: -' . $space_between_item . 'px;margin-right: -' . $space_between_item . 'px;" class="social-nav clearfix">'; $output .= $social_icons; $output .= '</ul>' . $custom_css . '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('readmore' => '', 'blog_pagination' => 'none', 'blog_type' => 'grid', 'blog_columns' => 3, 'blog_columns_tab' => 2, 'show_excerpt' => 'true', 'source' => 'all', 'categories' => '', 'posts' => '', 'authors' => '', 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'max_items' => 10, "excerpt_length" => 20, 'css' => '', 'css_animation' => '', 'el_class' => ''), $atts); extract($atts); $output = ''; $excerpt_length = intval($excerpt_length); $exl_function = create_function('$n', 'return ' . $excerpt_length . ';'); add_filter('excerpt_length', $exl_function, 999); $args = array('order' => $order, 'orderby' => $orderby, 'posts_per_page' => $max_items, 'ignore_sticky_posts' => true); if ($blog_pagination != 'none') { if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } $args['paged'] = $paged; } if ($orderby == 'meta_value' || $orderby == 'meta_value_num') { $args['meta_key'] = $meta_key; } if ($source == 'categories') { if ($categories) { $categories_arr = array_filter(explode(',', $categories)); if (count($categories_arr)) { $args['category__in'] = $categories_arr; } } } elseif ($source == 'posts') { if ($posts) { $posts_arr = array_filter(explode(',', $posts)); if (count($posts_arr)) { $args['post__in'] = $posts_arr; } } } elseif ($source == 'authors') { if ($authors) { $authors_arr = array_filter(explode(',', $authors)); if (count($authors_arr)) { $args['author__in'] = $authors_arr; } } } $layout = array('type' => $blog_type, 'columns' => $blog_columns, 'columns_tab' => $blog_columns_tab, 'pagination' => $blog_pagination); ob_start(); query_posts($args); if (have_posts()) { if ($blog_type == 'classic') { $readmore = ''; } $readmore_class = !$readmore || $readmore == 'none' ? ' no-readmore' : ''; echo '<div class="blog-posts blog-posts-' . esc_attr($layout['type']) . $readmore_class . '">'; if ($layout['type'] == 'grid' || $layout['type'] == 'masonry') { echo '<div class="row multi-columns-row">'; $article_columns = 12 / $layout['columns']; $article_columns_tab = 12 / $layout['columns_tab']; } if ($layout['type'] == 'masonry') { printf('<div class="blog-post-sizer col-lg-%1$s col-md-%1$s col-sm-%2$s col-xs-%2$s"></div>', $article_columns, $article_columns_tab); } $i = 1; while (have_posts()) { the_post(); /* Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ $format = get_post_format(); if ($layout['type'] == 'grid' || $layout['type'] == 'masonry') { printf('<div class="blog-post-wrap col-lg-%1$s col-md-%1$s col-sm-%2$s col-xs-%2$s">', $article_columns, $article_columns_tab); } if ($layout['type'] == 'zigzag') { $format = $i % 2 ? '' : 'even'; } get_template_part('templates/blog/' . $layout['type'] . '/content', $format); if ($layout['type'] == 'grid' || $layout['type'] == 'masonry') { echo '</div>'; } $i++; } if ($layout['type'] == 'grid' || $layout['type'] == 'masonry') { echo "</div><!-- .row -->"; } echo "</div><!-- .blog-posts -->"; /** * @hooked cruxstore_paging_nav */ do_action('cruxstore_loop_after', $layout); } wp_reset_query(); remove_filter('excerpt_length', $exl_function, 999); $output .= ob_get_clean(); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'blog-posts-wrapper ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('per_page' => '', 'orderby' => 'name', 'order' => 'ASC', 'ids' => '', 'hide_empty' => 'true', 'parent' => '', 'autoheight' => true, 'autoplay' => false, 'mousedrag' => true, 'autoplayspeed' => 5000, 'slidespeed' => 200, 'carousel_skin' => '', 'desktop' => 4, 'desktopsmall' => 3, 'tablet' => 2, 'mobile' => 1, 'gutters' => true, 'navigation' => true, 'navigation_always_on' => true, 'navigation_position' => 'center-outside', 'navigation_style' => 'normal', 'pagination' => false, 'pagination_position' => 'center-bottom', 'pagination_style' => 'dot-stroke', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); $atts['columns'] = $atts['desktop']; $atts['number'] = $atts['per_page']; $atts['hide_empty'] = apply_filters('sanitize_boolean', $atts['hide_empty']); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'products-brands-carousel ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'woocommerce' => 'woocommerce columns-' . $desktop, 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts), '', 'cruxstore-owl-carousel'); $output = $carousel_html = ''; if (isset($atts['ids'])) { $ids = explode(',', $atts['ids']); $ids = array_map('trim', $ids); } else { $ids = array(); } $hide_empty = $atts['hide_empty'] == true || $atts['hide_empty'] == 1 ? 1 : 0; // get terms and workaround WP bug with parents/pad counts $args = array('orderby' => $atts['orderby'], 'order' => $atts['order'], 'hide_empty' => $hide_empty, 'include' => $ids, 'pad_counts' => true, 'child_of' => $atts['parent']); $product_brands = get_terms('yith_product_brand', $args); if ('' !== $atts['parent']) { $product_brands = wp_list_filter($product_brands, array('parent' => $atts['parent'])); } if ($hide_empty) { foreach ($product_brands as $key => $brand) { if ($brand->count == 0) { unset($product_brands[$key]); } } } if ($atts['number']) { $product_brands = array_slice($product_brands, 0, $atts['number']); } ob_start(); if ($product_brands) { global $woocommerce_carousel; $woocommerce_carousel = 'normal'; $css_animation = cruxstore_getCSSAnimation($css_animation); foreach ($product_brands as $key => $term) { if ($animation_delay) { $animation_delay_item = sprintf(' data-wow-delay="%sms"', $key * $animation_delay); } else { $animation_delay_item = ''; } echo '<div class="brand-banner' . $css_animation . '"' . $animation_delay_item . '><div class="brand-banner-content">'; $thumbnail_id = absint(yith_wcbr_get_term_meta($term->term_id, 'thumbnail_id', true)); $image_size = apply_filters('cruxstore_brand_logo', 'cruxstore_grid'); if ($thumbnail_id) { $image = wp_get_attachment_image_src($thumbnail_id, $image_size); printf('<div class="brand-image"><img src="%s" width="%d" height="%d" alt="%s"/></div>', $image[0], $image[1], $image[2], $term->name); } else { do_action('yith_wcbr_no_brand_logo', $term->term_id, $term, 'yith_wcbr_logo_size', false, false); echo '<div class="brand-image">' . wc_placeholder_img() . '</div>'; } printf('<h4 class="brand-count"><span>%s</span> %s</a></h4>', $term->count, esc_html__('Products', 'cruxstore')); printf('<a href="%s">%s</a>', get_term_link($term), $term->name); echo '</div></div>'; } } wp_reset_postdata(); $carousel_html .= ob_get_clean(); if ($carousel_html) { $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = '<div class="' . esc_attr($elementClass) . '"><div class="products-brands-inner">' . str_replace('%carousel_html%', $carousel_html, $carousel_ouput) . '</div></div>'; } return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('img_size' => 'thumbnail', 'source' => 'all', 'categories' => '', 'posts' => '', 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'target_link' => '_self', 'image_overlay' => '', 'autoheight' => true, 'autoplay' => false, 'mousedrag' => true, 'autoplayspeed' => 5000, 'slidespeed' => 200, 'desktop' => 4, 'desktopsmall' => 3, 'tablet' => 2, 'mobile' => 1, 'gutters' => true, 'navigation' => true, 'navigation_always_on' => false, 'navigation_position' => 'center-outside', 'navigation_style' => 'normal', 'pagination' => false, 'pagination_position' => 'center-bottom', 'pagination_style' => 'dot-stroke', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); if ($image_overlay == 'white-boxed') { $atts['gutters'] = false; } $args = array('post_type' => 'crux_client', 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => -1, 'ignore_sticky_posts' => true); if ($orderby == 'meta_value' || $orderby == 'meta_value_num') { $args['meta_key'] = $meta_key; } if ($source == 'categories') { if ($categories) { $categories_arr = array_filter(explode(',', $categories)); if (count($categories_arr)) { $args['tax_query'] = array(array('taxonomy' => 'client-category', 'field' => 'slug', 'terms' => $categories)); } } } elseif ($source == 'posts') { if ($posts) { $posts_arr = array_filter(explode(',', $posts)); if (count($posts_arr)) { $args['post__in'] = $posts_arr; } } } $client_carousel_html = $post_thumbnail = ''; $query = new WP_Query($args); if ($query->have_posts()) { $css_animation = cruxstore_getCSSAnimation($css_animation); $i = 1; while ($query->have_posts()) { $query->the_post(); $link = cruxstore_meta('_cruxstore_link_client'); if ($animation_delay) { $animation_delay_item = sprintf(' data-wow-delay="%sms"', $i * $animation_delay); } else { $animation_delay_item = ''; } if ($link) { $post_thumbnail = '<a target="' . $target_link . '" href="' . $link . '">' . get_the_post_thumbnail(get_the_ID(), $img_size) . '</a>'; } else { $post_thumbnail = get_the_post_thumbnail(get_the_ID(), $img_size, ''); } $client_carousel_html .= sprintf('<div class="%s" %s>%s</div>', 'clients-carousel-item' . $css_animation, $animation_delay_item, $post_thumbnail); $i++; } wp_reset_postdata(); } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'clients-carousel ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); if ($image_overlay) { $elementClass['overlay'] = 'overlay-' . $image_overlay; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = ''; $output .= '<div class="' . esc_attr($elementClass) . '">'; $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts)); $output .= str_replace('%carousel_html%', $client_carousel_html, $carousel_ouput); $output .= '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'word' => 'false', 'line_color' => '#333333', 'border_width' => '1', 'line_width' => '', 'line_style' => '', 'size' => 'md', 'color' => 'grey', 'custom_color' => '', 'icon' => '', 'image' => '', 'spacer_position' => 'middle', 'spacer' => '', 'align' => 'center', 'font_size' => '', 'line_height' => '', 'letter_spacing' => '', 'font_container' => '', 'use_theme_fonts' => 'yes', 'google_fonts' => '', 'font_option' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); // This is needed to extract $font_container_data and $google_fonts_data extract($this->getAttributes($atts)); unset($font_container_data['values']['text_align']); $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts)); $settings = get_option('wpb_js_google_fonts_subsets'); if (is_array($settings) && !empty($settings)) { $subsets = '&subset=' . implode(',', $settings); } else { $subsets = ''; } if (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)) { $styles = array(); } $font_option = explode(',', $font_option); if (in_array('uppercase', $font_option)) { $styles[] = 'text-transform: uppercase;'; } if (in_array('underline', $font_option)) { $styles[] = 'text-decoration: underline;'; } if (in_array('italic', $font_option)) { $styles[] = 'font-style: italic;'; } if ($letter_spacing) { $styles[] = 'letter-spacing: ' . $letter_spacing . 'px'; } if (count($styles)) { $style = 'style="' . esc_attr(implode(';', $styles)) . '"'; } else { $style = ''; } $output = ''; $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cruxstore-heading ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'text-' . $align); $custom_css = ''; $rand = 'cruxstore_heading_' . rand(); if ($font_size) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .cruxstore-heading-title', 'font-size', $font_size); } if ($line_height) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .cruxstore-heading-title', 'line-height', $line_height); } if ($word == 'true') { $title_arr = preg_split("/\\s+/", $title); $title_arr[0] = "<span>" . $title_arr[0] . "</span>"; $title = join(" ", $title_arr); } $title = sprintf('<%1$s class="cruxstore-heading-title" %2$s>%3$s</%1$s>', $font_container_data['values']['tag'], $style, $title); $content = sprintf('<div class="cruxstore-heading-content">%s</div>', $content); $divider = ''; if ($spacer) { $elementClass['spacer'] = 'cruxstore-heading-' . $spacer_position; $divider_content = ''; $divider_class = array('cruxstore-heading-spacer', 'cruxstore-heading-' . $spacer); $styles_divider = array(); if (!$line_style) { $line_style = 'solid'; } if (!$border_width) { $border_width = 1; } if ($spacer == 'line') { $styles_divider[] = 'border-color: ' . $line_color; $styles_divider[] = 'border-top-width: ' . intval($border_width) . 'px'; $styles_divider[] = 'border-top-style: ' . $line_style; if ($line_width) { $styles_diver[] = 'width: ' . intval($line_width) . 'px'; } } elseif ($spacer == 'icon') { if ($icon) { $icon_style = ''; $icon_class = array('iconbox-ct', 'size-' . $size); if ($color != '' && $color != 'custom') { $icon_class[] = 'color-' . $color; $custom_color = cruxstore_color2Hex($color); } if ($custom_color) { $icon_style .= 'color: ' . $custom_color . ';'; } if ($icon_style) { $icon_style = sprintf('style="%s"', $icon_style); } $divider_content = sprintf('<span class="%s %s" %s></span>', $icon, implode(' ', $icon_class), $icon_style); } } elseif ($spacer == 'image') { $img_id = preg_replace('/[^\\d]/', '', $image); $img_url = wp_get_attachment_image_src($img_id, 'full'); if (array($img_url)) { $icon = sprintf('<img src="%s" class="img-responsive" alt="" />', $img_url['0']); } $divider_content = sprintf('<span class="%s">%s</span>', 'icon-image', $icon); } $styles_divider = 'style="' . esc_attr(implode(';', $styles_divider)) . '"'; $divider = '<div class="' . implode(' ', $divider_class) . '" ' . $styles_divider . '>' . $divider_content . '</div>'; } if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></div>'; } if ($spacer_position == 'bottom') { $output .= $title . $content . $divider; } elseif ($spacer_position == 'top') { $output .= $divider . $title . $content; } else { $output .= $title . $divider . $content; } $output .= $custom_css; if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div id="' . $rand . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'link' => '', 'skin' => '', 'readmore' => '', 'use_theme_fonts' => 'true', 'font_container' => '', 'google_fonts' => '', 'letter_spacing' => '0', 'icon_hover_div' => '', 'icon_type' => 'icon', 'icon_image' => '', 'icon_icon' => 'fa fa-adjust', 'icon_size' => 'md', 'icon_color' => '', 'icon_custom_color' => '', 'icon_color_hover' => '', 'icon_custom_color_hover' => '', 'icon_background_style' => 'default', 'icon_background_color' => 'grey', 'icon_custom_background_color' => '', 'icon_background_color_hover' => '', 'icon_custom_background_color_hover' => '', 'icon_box_layout' => '1', 'boxed_background_color' => 'grey', 'boxed_border_color' => 'grey', 'boxed_custom_background_color' => '', 'boxed_custom_border_color' => '', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts); extract($atts); $custom_css = $output = $style_title = ''; $uniqid = 'features-box-' . uniqid(); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'feature-box', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'layout' => 'layout-' . $icon_box_layout, 'size' => 'size-' . $icon_size); if ($icon_background_style == 'default') { $elementClass['style'] = 'style-' . $icon_background_style; } if ($skin) { $elementClass['skin'] = 'skin-' . $skin; } 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 ($letter_spacing) { $styles[] = 'letter-spacing: ' . $letter_spacing . 'px;'; } if (!empty($styles)) { $style_title .= 'style="' . esc_attr(implode(';', $styles)) . '"'; } if ($icon_box_layout == '2' || $icon_box_layout == '3' || $icon_box_layout == '4') { $icon_align = 'center'; } else { $icon_align = 'left'; } if ($icon_box_layout == '3' || $icon_box_layout == '4' || $icon_box_layout == '6') { $elementClass['boxed'] = 'background-' . $boxed_background_color; } if ($icon_box_layout == '4') { $elementClass['border'] = 'border-' . $boxed_border_color; } $icon_box_icon = do_shortcode('[cruxstore_icon hover_div="#' . $uniqid . ':hover .iconbox-ct" link="' . $link . '" type = "' . $icon_type . '" image = "' . $icon_image . '" icon = "' . $icon_icon . '" size = "' . $icon_size . '" color = "' . $icon_color . '" custom_color = "' . $icon_custom_color . '" color_hover = "' . $icon_color_hover . '" custom_color_hover = "' . $icon_custom_color_hover . '" background_style = "' . $icon_background_style . '" background_color = "' . $icon_background_color . '" custom_background_color = "' . $icon_custom_background_color . '" background_color_hover = "' . $icon_background_color_hover . '" custom_background_color_hover = "' . $icon_custom_background_color_hover . '" align="' . $icon_align . '"]'); if ($icon_box_icon) { $icon_box_icon = '<div class="feature-box-icon">' . $icon_box_icon . '</div>'; } $icon_readmore = ''; $link = $link == '||' ? '' : $link; 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) . '"'); if ($title) { $style_link = ''; if (isset($font_container_data['values']['color'])) { $style_link .= ' style="color: ' . $font_container_data['values']['color'] . '"'; } $title = '<a ' . implode(' ', $icon_box_link) . $style_link . '>' . $title . '</a>'; } $icon_readmore = '<div class="feature-box-readmore"><a ' . implode(' ', $icon_box_link) . '>' . $readmore . '</a></div>'; } $icon_box_title = $title ? '<' . $font_container_data['values']['tag'] . ' class="feature-box-title" ' . $style_title . '>' . $title . '</' . $font_container_data['values']['tag'] . '>' : ''; $icon_box_content = $content ? '<div class="feature-box-content">' . $content . '</div>' : ''; $output .= $icon_box_icon . $icon_box_title . $icon_box_content . $icon_readmore; if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></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 id="' . $uniqid . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '><div class="feature-box-inner">' . $output . $custom_css . '</div></div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('hover_div' => '', 'link' => '', 'type' => 'icon', 'image' => '', 'svg' => '', 'icon' => 'fa fa-adjust', 'size' => 'md', 'color' => '', 'custom_color' => '', 'color_hover' => '', 'custom_color_hover' => '', 'background_style' => 'default', 'background_color' => 'grey', 'custom_background_color' => '', 'background_color_hover' => '', 'custom_background_color_hover' => '', 'align' => 'center', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts); extract($atts); $custom_css = $output = $icon_style = ''; $uniqid = 'icon-box-' . uniqid(); if (!$hover_div) { $hover_div = '#' . $uniqid . ' .iconbox-ct:hover'; } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'iconbox', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'text-' . $align); $icon_class = array(); if ($type == 'image') { $img_id = preg_replace('/[^\\d]/', '', $image); $img_url = wp_get_attachment_image_src($img_id, 'full'); if (array($img_url)) { $icon = sprintf('<img src="%s" class="img-responsive" alt="" />', $img_url['0']); } $output = sprintf('<span class="%s %s" %s>%s</span>', 'icon-image', implode(' ', $icon_class), $icon_style, $icon); } else { if ($type == 'svg' && !$svg || $type == 'icon' && !$icon) { return; } $icon_class = array('iconbox-ct', 'size-' . $size, 'style-' . $background_style); if ($background_style != '' && $background_style != 'default') { $icon_class[] = 'style-special'; } if ($background_color != '' && $background_color != 'custom') { $icon_class[] = 'background-' . $background_color; $custom_background_color = cruxstore_color2Hex($background_color); } if ($custom_background_color && $background_style != 'default') { if (strpos($background_style, 'outline') !== false) { $icon_style .= 'border-color: ' . $custom_background_color . ';'; } else { $icon_style .= 'background: ' . $custom_background_color . ';'; } } if ($background_color_hover != '') { $custom_background_color_hover = cruxstore_color2Hex($background_color_hover); } if ($custom_background_color_hover && $background_style != 'default') { if (strpos($background_style, 'outline') !== false) { $custom_css .= $hover_div . ' {border-color:' . $custom_background_color_hover . '!important;}'; } else { $custom_css .= $hover_div . ' {background:' . $custom_background_color_hover . '!important;}'; } } if ($color != '' && $color != 'custom') { $icon_class[] = 'color-' . $color; $custom_color = cruxstore_color2Hex($color); } if ($custom_color) { $icon_style .= 'color: ' . $custom_color . ';'; if ($type == 'svg') { $custom_css .= '#' . $uniqid . ' path{fill:' . $custom_color . '!important;}'; } } if ($color_hover != '') { $custom_color_hover = cruxstore_color2Hex($color_hover); } if ($custom_color_hover) { if ($type == 'svg') { $custom_css .= $hover_div . ' path{fill:' . $custom_color_hover . '!important;}'; } else { $custom_css .= $hover_div . ' {color:' . $custom_color_hover . '!important;}'; } } if ($icon_style) { $icon_style = sprintf('style="%s"', $icon_style); } if ($type == 'svg') { $svg = '<span class="svg-content">' . rawurldecode(base64_decode(strip_tags($svg))) . '</span>'; $icon = 'icon-svg'; } else { $svg = ''; } $output = sprintf('<span class="%s %s" %s>%s</span>', $icon, implode(' ', $icon_class), $icon_style, $svg); } $url = vc_build_link($link); $rel = ''; if (!empty($url['rel'])) { $rel = ' rel="' . esc_attr($url['rel']) . '"'; } if (strlen($link) > 0 && strlen($url['url']) > 0) { $output = '<a class="iconbox-link" href="' . esc_attr($url['url']) . '" ' . $rel . ' title="' . esc_attr($url['title']) . '" target="' . (strlen($url['target']) > 0 ? esc_attr($url['target']) : '_self') . '">' . $output . '</a>'; } if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></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 id="' . $uniqid . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . $custom_css . '</div>'; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => '', 'image' => '', 'link' => '', 'link_text' => '', 'link_color' => 'default', 'img_size' => 'full', 'align' => 'center', 'skin' => '', 'overlay' => '', 'position' => 'middle', 'style' => 1, 'font_container' => '', 'use_theme_fonts' => 'yes', 'google_fonts' => '', 'font_size' => '', 'line_height' => '', 'letter_spacing' => '', 'font_option' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); // This is needed to extract $font_container_data and $google_fonts_data extract($this->getAttributes($atts)); unset($font_container_data['values']['text_align']); $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts)); $settings = get_option('wpb_js_google_fonts_subsets'); if (is_array($settings) && !empty($settings)) { $subsets = '&subset=' . implode(',', $settings); } else { $subsets = ''; } if (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)) { $styles = array(); } $font_option = explode(',', $font_option); if (in_array('uppercase', $font_option)) { $styles[] = 'text-transform: uppercase;'; } if (in_array('underline', $font_option)) { $styles[] = 'text-decoration: underline;'; } if (in_array('italic', $font_option)) { $styles[] = 'font-style: italic;'; } if ($letter_spacing) { $styles[] = 'letter-spacing: ' . $letter_spacing . 'px'; } if (count($styles)) { $style_banner = 'style="' . esc_attr(implode(';', $styles)) . '"'; } else { $style_banner = ''; } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'banner ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'extra' => $this->getExtraClass($el_class), 'align' => 'banner-' . $align, 'position' => 'position-' . $position, 'style' => 'style-' . $style); if ($overlay) { $elementClass['overlay'] = 'banner-' . $overlay; } if ($skin) { $elementClass['skin'] = 'skin-' . $skin; } $rand = 'banner_id_' . rand(); $custom_css = $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') . '" />'; } if ($title) { $title = sprintf('<%1$s class="banner-title" %2$s><span>%3$s</span></%1$s>', $font_container_data['values']['tag'], $style_banner, $title); if ($font_size) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .banner-title', 'font-size', $font_size); } if ($line_height) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .banner-title', 'line-height', $line_height); } } if ($content) { $content = sprintf('<div class="banner-inner">%s</div>', $content); } $icon = $style == 1 ? 'fa fa-caret-right' : 'fa fa-long-arrow-right'; $more = $link_text ? sprintf('<div class="banner-more banner-more-%s"><span>%s <i class="%s" aria-hidden="true"></i></span></div>', $link_color, $link_text, $icon) : ''; $output = $img['thumbnail']; $output .= sprintf('<div class="banner-content">%s</div>', $title . $content . $more); 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; if ($animation_delay) { $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay); } if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></div>'; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $elementClass = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $elementClass, $this->settings['base'], $atts); return '<div id="' . $rand . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . $custom_css . '</div>'; }