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('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) { 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>'; }
function getCustomStyle($atts) { $styles = array(); $google_fonts_data = $font_container_data = $style = ''; 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); } $output = array('style' => $styles, 'data' => $font_container_data); return $output; }
function df_googlefont_sc_enqueue() { wp_enqueue_style('df_google_fonts_' . vc_build_safe_css_class($google), '//fonts.googleapis.com/css?family=' . $google); // wp_enqueue_style( 'df_google_fonts_' . vc_build_safe_css_class( $google )); }
* Shortcode class * @var $this WPBakeryShortCode_VC_Custom_heading */ // This is needed to extract $font_container_data and $google_fonts_data extract($this->getAttributes($atts)); $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)) { $style = 'style="' . esc_attr(implode(';', $styles)) . '"'; } else { $style = ''; } if ('post_title' === $source) { $text = get_the_title(get_the_ID()); } if (!empty($link)) { $link = vc_build_link($link); $text = '<a href="' . esc_attr($link['url']) . '"' . ($link['target'] ? ' target="' . esc_attr($link['target']) . '"' : '') . ($link['title'] ? ' title="' . esc_attr($link['title']) . '"' : '') . '>' . $text . '</a>'; } $output = ''; if (apply_filters('vc_custom_heading_template_use_wrapper', false)) {
/** * @param $settings * @param $value * * @return string */ public function render($settings, $value) { $fields = array(); $values = array(); extract($this->_vc_font_container_parse_attributes($settings['settings']['fields'], $value)); $data = array(); $output = ''; if (!empty($fields)) { if (isset($fields['tag'])) { $data['tag'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Element tag', 'js_composer') . '</div> <div class="vc_font_container_form_field-tag-container"> <select class="vc_font_container_form_field-tag-select">'; $tags = $this->_vc_font_container_get_allowed_tags(); foreach ($tags as $tag) { $data['tag'] .= '<option value="' . $tag . '" class="' . $tag . '" ' . ($values['tag'] == $tag ? 'selected="selected"' : '') . '>' . __($tag, 'js_composer') . '</option>'; } $data['tag'] .= ' </select> </div>'; if (isset($fields['tag_description']) && strlen($fields['tag_description']) > 0) { $data['tag'] .= ' <span class="vc_description clear">' . $fields['tag_description'] . '</span> '; } $data['tag'] .= '</div>'; } if (isset($fields['font_size'])) { $data['font_size'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Font size', 'js_composer') . '</div> <div class="vc_font_container_form_field-font_size-container"> <input class="vc_font_container_form_field-font_size-input" type="text" value="' . $values['font_size'] . '" /> </div>'; if (isset($fields['font_size_description']) && strlen($fields['font_size_description']) > 0) { $data['font_size'] .= ' <span class="vc_description clear">' . $fields['font_size_description'] . '</span> '; } $data['font_size'] .= '</div>'; } if (isset($fields['text_align'])) { $data['text_align'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Text align', 'js_composer') . '</div> <div class="vc_font_container_form_field-text_align-container"> <select class="vc_font_container_form_field-text_align-select"> <option value="left" class="left" ' . ($values['text_align'] == 'left' ? 'selected="selected"' : '') . '>' . __('left', 'js_composer') . '</option> <option value="right" class="right" ' . ($values['text_align'] == 'right' ? 'selected="selected"' : '') . '>' . __('right', 'js_composer') . '</option> <option value="center" class="center" ' . ($values['text_align'] == 'center' ? 'selected="selected"' : '') . '>' . __('center', 'js_composer') . '</option> <option value="justify" class="justify" ' . ($values['text_align'] == 'justify' ? 'selected="selected"' : '') . '>' . __('justify', 'js_composer') . '</option> </select> </div>'; if (isset($fields['text_align_description']) && strlen($fields['text_align_description']) > 0) { $data['text_align'] .= ' <span class="vc_description clear">' . $fields['text_align_description'] . '</span> '; } $data['text_align'] .= '</div>'; } if (isset($fields['line_height'])) { $data['line_height'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Line height', 'js_composer') . '</div> <div class="vc_font_container_form_field-line_height-container"> <input class="vc_font_container_form_field-line_height-input" type="text" value="' . $values['line_height'] . '" /> </div>'; if (isset($fields['line_height_description']) && strlen($fields['line_height_description']) > 0) { $data['line_height'] .= ' <span class="vc_description clear">' . $fields['line_height_description'] . '</span> '; } $data['line_height'] .= '</div>'; } if (isset($fields['color'])) { $data['color'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Text color', 'js_composer') . '</div> <div class="vc_font_container_form_field-color-container"> <div class="color-group"> <input type="text" value="' . $values['color'] . '" class="vc_font_container_form_field-color-input vc_color-control" /> </div> </div>'; if (isset($fields['color_description']) && strlen($fields['color_description']) > 0) { $data['color'] .= ' <span class="vc_description clear">' . $fields['color_description'] . '</span> '; } $data['color'] .= '</div>'; } if (isset($fields['font_family'])) { $data['font_family'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Font Family', 'js_composer') . '</div> <div class="vc_font_container_form_field-font_family-container"> <select class="vc_font_container_form_field-font_family-select">'; $fonts = $this->_vc_font_container_get_web_safe_fonts(); foreach ($fonts as $font_name => $font_data) { $data['font_family'] .= '<option value="' . $font_name . '" class="' . vc_build_safe_css_class($font_name) . '" ' . (strtolower($values['font_family']) == strtolower($font_name) ? 'selected="selected"' : '') . ' data[font_family]="' . urlencode($font_data) . '">' . __($font_name, 'js_composer') . '</option>'; } $data['font_family'] .= ' </select> </div>'; if (isset($fields['font_family_description']) && strlen($fields['font_family_description']) > 0) { $data['font_family'] .= ' <span class="vc_description clear">' . $fields['font_family_description'] . '</span> '; } $data['font_family'] .= '</div>'; } if (isset($fields['font_style'])) { $data['font_style'] = ' <div class="vc_row-fluid vc_column"> <div class="wpb_element_label">' . __('Font style', 'js_composer') . '</div> <div class="vc_font_container_form_field-font_style-container"> <label> <input type="checkbox" class="vc_font_container_form_field-font_style-checkbox italic" value="italic" ' . ($values['font_style_italic'] == "1" ? 'checked="checked"' : '') . '><span class="vc_font_container_form_field-font_style-label italic">' . __('italic', 'js_composer') . '</span> </label> <br /> <label> <input type="checkbox" class="vc_font_container_form_field-font_style-checkbox bold" value="bold" ' . ($values['font_style_bold'] == "1" ? 'checked="checked"' : '') . '><span class="vc_font_container_form_field-font_style-label bold">' . __('bold', 'js_composer') . '</span> </label> </div>'; if (isset($fields['font_style_description']) && strlen($fields['font_style_description']) > 0) { $data['font_style'] .= ' <span class="vc_description clear">' . $fields['font_style_description'] . '</span> '; } $data['font_style'] .= '</div>'; } $data = apply_filters('vc_font_container_output_data', $data, $fields, $values, $settings); // combine all in output, make sure you follow ordering foreach ($fields as $key => $field) { if (isset($data[$key])) { $output .= $data[$key]; } } } $output .= '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '" />'; return $output; }
foreach ($fonts as $font_data) { ?> <option value="<?php echo $font_data->font_family . ':' . $font_data->font_styles; ?> " data[font_types]="<?php echo $font_data->font_types; ?> " data[font_family]="<?php echo $font_data->font_family; ?> " data[font_styles]="<?php echo $font_data->font_styles; ?> " class="<?php echo vc_build_safe_css_class($font_data->font_family); ?> " <?php echo strtolower($values['font_family']) == strtolower($font_data->font_family) || strtolower($values['font_family']) == strtolower($font_data->font_family) . ':' . $font_data->font_styles ? 'selected="selected"' : ''; ?> ><?php _e($font_data->font_family, 'js_composer'); ?> </option> <?php } ?> </select> </div> <?php if (isset($fields['font_family_description']) && strlen($fields['font_family_description']) > 0) {
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'source' => 'widgets', 'categories' => '', 'per_page' => 8, 'orderby' => 'date', 'order' => 'DESC', 'style' => 1, 'active_section' => 1, 'font_size' => '', 'line_height' => '', 'letter_spacing' => '', 'font_container' => '', 'use_theme_fonts' => 'yes', 'google_fonts' => '', 'css_animation' => '', 'el_class' => '', 'css' => '', 'operator' => 'IN'), $atts); $columns = 3; $product_type = 'classic'; // 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 ($letter_spacing) { if (empty($styles)) { $styles = array(); } $styles[] = 'letter-spacing: ' . $letter_spacing . 'px'; } if (!empty($styles)) { $style = 'style="' . esc_attr(implode(';', $styles)) . '"'; } else { $style = ''; } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wc-products-vertical', $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 cruxstore-products-classic', 'woocommerce' => 'woocommerce columns-' . $columns); if (!$active_section) { $active_section = 1; } $uniqeID = uniqid(); $meta_query = WC()->query->get_meta_query(); $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $atts['per_page'], 'meta_query' => $meta_query); if ($source == 'categories') { $tabs = explode(',', $categories); $args['order'] = $order; $args['orderby'] = $orderby; } else { $tabs = array('onsale', 'new', 'bestselling'); } $tab_heading = '<ul class="nav-style" data-count="' . count($tabs) . '">'; $i = 1; foreach ($tabs as $tab) { if ($source == 'categories') { $term = get_term_by('slug', sanitize_title($tab), 'product_cat'); $text = $term->name; } else { if ($tab == 'new') { $text = esc_html__('Arrivals Products', 'cruxstore'); } elseif ($tab == 'bestselling') { $text = esc_html__('Best Sellers', 'cruxstore'); } elseif ($tab == 'onsale') { $text = esc_html__('On sale', 'cruxstore'); } } $class = $active_section == $i ? ' class="active"' : ''; $tab_heading .= sprintf('<li %s><a href="%s" data-toggle="tab"><span data-hover="%s">%s</span></a></li>', $class, '#tab-' . $tab . '-' . $uniqeID, esc_attr($text), $text); $i++; } $tab_heading .= "</ul>"; global $woocommerce_loop; $i = 1; $output_content = ''; $carousel_atts = array('desktop' => $columns, 'navigation' => false, 'gutters' => false); $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $carousel_atts), '', 'wc-carousel-wrapper'); foreach ($tabs as $tab) { $new_args = $args; if ($source == 'categories') { $new_args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => sanitize_title($tab), 'field' => 'slug', 'operator' => $atts['operator'])); } else { if ($tab == 'bestselling') { $new_args['meta_key'] = 'total_sales'; $new_args['orderby'] = 'meta_value_num'; } elseif ($tab == 'featured') { $new_args['meta_query'][] = array('key' => '_featured', 'value' => 'yes'); } elseif ($tab == 'onsale') { $new_args['post__in'] = array_merge(array(0), wc_get_product_ids_on_sale()); } } $products = new WP_Query(apply_filters('woocommerce_shortcode_products_query', $new_args, $atts)); $woocommerce_loop['columns'] = $columns; $woocommerce_loop['type'] = $product_type; ob_start(); if ($products->have_posts()) { woocommerce_product_loop_start(); while ($products->have_posts()) { $products->the_post(); wc_get_template_part('content', 'product'); } // end of the loop. woocommerce_product_loop_end(); } wp_reset_postdata(); $carousel_html = ob_get_clean(); $carousel_html = str_replace('%carousel_html%', $carousel_html, $carousel_ouput); $class = $active_section == $i ? 'fade in active' : 'fade'; $output_content .= sprintf('<div id="%s" class="tab-pane %s">%s</div><!-- .tab-pane -->', 'tab-' . $tab . '-' . $uniqeID, $class, $carousel_html); $i++; } $custom_css = ''; $rand = 'wc-products-vertical-' . rand(); if ($font_size) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .wc-products-vertical-title', 'font-size', $font_size); } if ($line_height) { $custom_css .= cruxstore_responsive_render('#' . $rand . ' .wc-products-vertical-title', 'line-height', $line_height); } $title = sprintf('<%1$s class="wc-products-vertical-title" %2$s>%3$s</%1$s>', $font_container_data['values']['tag'], $style, $title); $heading = sprintf('<div class="wc-products-vertical-heading">%s</div>', $tab_heading); $navigation = '<div class="wc-products-vertical-navigation"><span class="wc-products-vertical-left"><i class="fa fa-angle-left" aria-hidden="true"></i></span><span class="wc-products-vertical-right"><i class="fa fa-angle-right" aria-hidden="true"></i></span></div>'; $content = $content ? sprintf('<div class="wc-products-vertical-content">%s</div>', $content) : ''; $output = sprintf('<div class="row"><div class="col-md-3">%s</div><div class="col-md-9"><div class="tab-content">%s</div></div></div>', $title . $content . $heading . $navigation, $output_content); if ($custom_css) { $custom_css = '<div class="cruxstore_custom_css" data-css="' . esc_attr($custom_css) . '"></div>'; } $output .= $custom_css; $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = '<div id="' . $rand . '" class="' . esc_attr($elementClass) . '">' . $output . '</div>'; return $output; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => __('Title', 'js_composer'), 'layout' => '1', 'from' => '0', 'to' => '100', 'speed' => '2000', 'prefix' => '', 'suffix' => '', 'skin' => '', 'use_theme_fonts' => 'yes', 'font_container' => '', 'google_fonts' => '', 'use_theme_fonts_value' => 'yes', 'font_container_value' => '', 'google_fonts_value' => '', 'icon_hover_div' => '', 'icon_type' => 'icon', 'icon_image' => '', 'icon_icon' => '', 'icon_size' => 'md', 'icon_color' => '', 'icon_custom_color' => '', 'icon_color_hover' => '', 'icon_custom_color_hover' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'counter-wrapper ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'layout' => 'layout-' . $layout, 'size' => 'size-' . $icon_size); if ($skin) { $elementClass['skin'] = 'skin-' . $skin; } $uniqid = 'counter-' . uniqid(); $style_title = $output = ''; 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)) . '"'; } $counter_text = '<div class="counter-text" ' . $style_title . '>' . $title . '</div>'; $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 .= 'style="' . esc_attr(implode(';', $styles)) . '"'; } $decimals = explode('.', $to); $decimals_html = ''; if (count($decimals) > 1) { $decimals_html = 'data-decimals="' . esc_attr(strlen($decimals[1])) . '"'; } $from_attr = $from ? 'data-from="' . $from . '"' : 'data-from="0"'; $speed = $speed ? $speed : 1; $counter_content = '<' . $font_container_data['values']['tag'] . ' class="counter-content" ' . $style_value . '>' . $prefix . '<span class="counter" ' . $from_attr . ' data-speed="' . intval($speed) . '" ' . $decimals_html . ' data-to="' . esc_attr($to) . '">' . $from . '</span>' . $suffix . '</' . $font_container_data['values']['tag'] . '>'; if ($layout == '4') { $algin = 'left'; } else { $algin = 'center'; } $counter_icon = do_shortcode('[cruxstore_icon hover_div="#' . $uniqid . ':hover .iconbox-ct" 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 . '" align="' . $algin . '"]'); if ($layout == '3') { $output = $counter_content . $counter_icon . $counter_text; } else { $output = $counter_icon . $counter_content . $counter_text; } $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('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('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>'; }