function buildStyle($bg_image = '', $bg_color = '', $bg_image_repeat = '', $font_color = '', $padding = '', $margin_bottom = '') { $has_image = false; $style = ''; if ((int) $bg_image > 0 && ($image_url = wp_get_attachment_url($bg_image, 'large')) !== false) { $has_image = true; $style .= "background-image: url(" . $image_url . ");"; } if (!empty($bg_color)) { $style .= vc_get_css_color('background-color', $bg_color); } if (!empty($bg_image_repeat) && $has_image) { if ($bg_image_repeat === 'cover') { $style .= "background-repeat:no-repeat;background-size: cover;"; } elseif ($bg_image_repeat === 'contain') { $style .= "background-repeat:no-repeat;background-size: contain;"; } elseif ($bg_image_repeat === 'no-repeat') { $style .= 'background-repeat: no-repeat;'; } } if (!empty($font_color)) { $style .= vc_get_css_color('color', $font_color); // 'color: '.$font_color.';'; } if ($padding != '') { $style .= 'padding: ' . (preg_match('/(px|em|\\%|pt|cm)$/', $padding) ? $padding : $padding . 'px') . ';'; } if ($margin_bottom != '') { $style .= 'margin-bottom: ' . (preg_match('/(px|em|\\%|pt|cm)$/', $margin_bottom) ? $margin_bottom : $margin_bottom . 'px') . ';'; } return empty($style) ? $style : ' style="' . $style . '"'; }
} } if ('custom' === $style) { if ($custom_background) { $styles[] = vc_get_css_color('background-color', $custom_background); } if ($custom_text) { $styles[] = vc_get_css_color('color', $custom_text); } if (!$custom_background && !$custom_text) { $button_classes[] = 'vc_btn3-color-grey'; } } elseif ('outline-custom' === $style) { if ($outline_custom_color) { $styles[] = vc_get_css_color('border-color', $outline_custom_color); $styles[] = vc_get_css_color('color', $outline_custom_color); $attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"'; } else { $attributes[] = 'onmouseleave="this.style.borderColor=\'\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'\'"'; } $onmouseenter = array(); if ($outline_custom_hover_background) { $onmouseenter[] = 'this.style.borderColor=\'' . $outline_custom_hover_background . '\';'; $onmouseenter[] = 'this.style.backgroundColor=\'' . $outline_custom_hover_background . '\';'; } if ($outline_custom_hover_text) { $onmouseenter[] = 'this.style.color=\'' . $outline_custom_hover_text . '\';'; } if ($onmouseenter) { $attributes[] = 'onmouseenter="' . implode(' ', $onmouseenter) . '"'; }
$atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); if (!empty($type)) { vc_icon_element_fonts_enqueue($type); $icon = ${"icon_" . $type}; } $class = "call-to-action"; // $position = 'left'; // $width = '90'; // $style = ''; // $txt_align = 'right'; $link = $link == '||' ? '' : $link; $class .= $position != '' ? ' button-' . $position : ''; $class .= $txt_align != '' ? ' text-' . $txt_align : ''; $inline_css = $accent_color != '' ? ' style="' . esc_attr(vc_get_css_color('background-color', $accent_color) . vc_get_css_color('border-color', $accent_color)) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); $data_attr = ''; if ($animation) { $data_attr = ' data-animation="' . esc_attr($animation) . '"'; } if ($animation_delay) { $data_attr .= ' data-animation-delay="' . floatval($animation_delay) . '"'; } ?> <div<?php echo $inline_css; ?> class="<?php echo esc_attr($css_class);
} } } $col_name = vc_column_offset_class_merge($offset, $w); $css_class[] = 'column wpb_column'; if (!empty($el_class)) { $css_class[] = $el_class; } if (!empty($alt_color)) { $css_class[] = 'alt-color'; } if (!empty($alt_bg_color)) { $css_class[] = 'alt-background-color'; } if (!empty($padding_size)) { $css_class[] = $padding_size; } if (!empty($text_align)) { $css_class[] = 'text-' . $text_align; } $style = ''; if (!empty($font_color)) { $style .= vc_get_css_color('color', $font_color); } $item_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $col_name . ' ' . implode(' ', $css_class) . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts); $output .= "\n\t" . '<div class="' . esc_attr($item_class) . '"' . (empty($style) ? $style : ' style="' . esc_attr($style) . '"') . '>'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= "\n\t\t\t" . wpb_js_remove_wpautop($content); $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($el_class) . "\n"; echo $output;
$class = "vc_call_to_action wpb_content_element"; // $position = 'left'; // $width = '90'; // $style = ''; // $txt_align = 'right'; $link = $link == '||' ? '' : $link; $class .= $position != '' ? ' vc_cta_btn_pos_' . $position : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ''; $class .= $color != '' ? ' vc_cta_' . $color : ''; $class .= $style != '' ? ' vc_cta_' . $style : ''; $class .= $txt_align != '' ? ' vc_txt_align_' . $txt_align : ''; $inline_css = ''; if ($accent_color != '') { $inline_css .= vc_get_css_color('background', $accent_color) . ';'; if ($style == 'square_outlined') { $inline_css .= vc_get_css_color('border-color', $accent_color) . ';'; } $accent_color_l = om_color_lightness($accent_color, 0.03); $accent_color_d = om_color_lightness($accent_color, -0.03); $inline_css .= 'background:-moz-linear-gradient(left, ' . $accent_color_d . ' 0%, ' . $accent_color_l . ' 100%);' . 'background:-webkit-gradient(linear, left top, right top, color-stop(0%,' . $accent_color_d . '), color-stop(100%,' . $accent_color_l . '));' . 'background:-webkit-linear-gradient(left, ' . $accent_color_d . ' 0%,' . $accent_color_l . ' 100%);' . 'background:-ms-linear-gradient(left, ' . $accent_color_d . ' 0%,' . $accent_color_l . ' 100%);' . 'background:linear-gradient(to right, ' . $accent_color_d . ' 0%,' . $accent_color_l . ' 100%);'; } $inline_css .= $text_color != '' ? 'color:' . $text_color . ';' : ''; $button_html = ''; if ($link) { $button_html = do_shortcode('[vc_button2 link="' . $link . '" title="' . $title . '" color="' . $color . '" custom_color="' . $btn_custom_color . '" text_color="' . $btn_text_color . '" text_custom_color="' . $btn_text_custom_color . '" icon="' . $icon . '" size="' . $size . '" style="' . $btn_style . '" el_class="vc_cta_btn"]'); $class .= ' vc_with_btn'; } $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); $css_class .= $this->getCSSAnimation($css_animation); ?>
public function getHeading($tag, $atts) { $inline_css = ''; if (isset($atts[$tag]) && '' !== trim($atts[$tag])) { if (isset($atts['use_custom_fonts_' . $tag]) && 'true' === $atts['use_custom_fonts_' . $tag]) { $custom_heading = visual_composer()->getShortCode('vc_custom_heading'); $data = vc_map_integrate_parse_atts($this->shortcode, 'vc_custom_heading', $atts, $tag . '_'); $data['font_container'] = implode('|', array_filter(array('tag:' . $tag, $data['font_container']))); $data['text'] = $atts[$tag]; // provide text to shortcode return $custom_heading->render(array_filter($data)); } else { if (isset($atts['style']) && 'custom' === $atts['style']) { if (!empty($atts['custom_text'])) { $inline_css[] = vc_get_css_color('color', $atts['custom_text']); } } if (!empty($inline_css)) { $inline_css = ' style="' . implode('', $inline_css) . '"'; } return '<' . $tag . $inline_css . '>' . $atts[$tag] . '</' . $tag . '>'; } } return ''; }
<?php $style = $color = $sep_align = $sep_width = $border_width = $m_top = $m_bottom = $accent_color = ''; extract(shortcode_atts(array('style' => '', 'color' => '', 'sep_align' => 'left', 'sep_width' => '60px', 'border_width' => '1', 'm_top' => '10px', 'm_bottom' => '10px', 'accent_color' => ''), $atts)); $class = "wpsm_sep_line"; $class .= $sep_align != '' ? ' wpsm_sep_' . $sep_align : ''; $style_inline = $style != '' ? 'border-style: ' . $style . '' : 'border-style: solid;'; $sep_color_inline = $color != 'custom' ? vc_get_css_color('border-color', $color) : vc_get_css_color('border-color', $accent_color); $sep_width_inline = $sep_width != '' ? 'width: ' . $sep_width . ';' : ''; $sep_height_inline = $border_width != '' ? 'height: ' . $border_width . 'px;' : ''; $sep_height_border_inline = $border_width != '' ? 'border-bottom-width: ' . $border_width . 'px;' : ''; $sep_inline_m_top = $m_top != '' ? 'margin-top: ' . $m_top . ';' : ''; $sep_inline_m_bottom = $m_bottom != '' ? 'margin-bottom: ' . $m_bottom . ';' : ''; $inline_css_wrap = $sep_inline_m_top . $sep_inline_m_bottom . $sep_height_inline; $inline_css = $sep_color_inline . $sep_width_inline . $sep_height_border_inline . $style_inline; ?> <div class="<?php echo esc_attr(trim($class)); ?> " style="<?php echo $inline_css_wrap; ?> "> <span style="<?php echo $inline_css; ?> "></span> </div> <?php echo $this->endBlockComment('separator') . "\n";
<?php extract(shortcode_atts(array('title' => '', 'heading_size' => 'h4', 'title_align' => '', 'text_transform' => '', 'el_width' => '', 'border_width' => '1', 'heading_size' => 'h4', 'style' => '', 'color' => '', 'desc' => '', 'accent_color' => '', 'el_class' => ''), $atts)); $class = "vc_separator wpb_content_element"; $class .= $title_align != '' ? ' vc_' . $title_align : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ' vc_el_width_100'; $class .= $style != '' ? ' vc_sep_' . $style : ''; $class .= $color != '' ? ' vc_sep_color_' . $color : ''; $inline_css = $accent_color != '' ? ' style="' . vc_get_css_color('border-color', $accent_color) . 'border-width: ' . esc_attr($border_width) . 'px;"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> "> <div class="cs_separator_title"> <span class="vc_sep_holder vc_sep_holder_l"><span<?php echo '' . $inline_css; ?> class="vc_sep_line"></span></span> <?php if ($title != '') { ?> <<?php echo esc_attr($heading_size); if ($text_transform) { echo " style='text-transform: {$text_transform};'"; } ?> ><?php
$class = "vc_call_to_action wpb_content_element"; // $position = 'left'; // $width = '90'; // $style = ''; // $txt_align = 'right'; $link = $link == '||' ? '' : $link; $class .= $add_button != '' ? ' vc_cta_btn_pos_' . $add_button : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ''; $class .= $color != '' ? ' vc_cta_' . $color : ''; $class .= $style != '' ? ' vc_cta_' . $style : ''; $class .= $txt_align != '' ? ' vc_txt_align_' . $txt_align : ''; $inline_css = ''; if ($custom_background != '') { $inline_css .= vc_get_css_color('background', $custom_background) . ';'; if ($style == 'square_outlined') { $inline_css .= vc_get_css_color('border-color', $custom_background) . ';'; } $custom_background_l = om_color_lightness($custom_background, 0.03); $custom_background_d = om_color_lightness($custom_background, -0.03); $inline_css .= 'background:-moz-linear-gradient(left, ' . $custom_background_d . ' 0%, ' . $custom_background_l . ' 100%);' . 'background:-webkit-gradient(linear, left top, right top, color-stop(0%,' . $custom_background_d . '), color-stop(100%,' . $custom_background_l . '));' . 'background:-webkit-linear-gradient(left, ' . $custom_background_d . ' 0%,' . $custom_background_l . ' 100%);' . 'background:-ms-linear-gradient(left, ' . $custom_background_d . ' 0%,' . $custom_background_l . ' 100%);' . 'background:linear-gradient(to right, ' . $custom_background_d . ' 0%,' . $custom_background_l . ' 100%);'; } $inline_css .= $custom_text != '' ? 'color:' . $custom_text . ';' : ''; $button_html = ''; if ($add_button) { $btn_atts = ''; foreach ($atts as $k => $v) { if (strpos($k, 'btn_') === 0) { $btn_atts .= ' ' . substr($k, 4) . '="' . esc_attr($v) . '"'; } } $button_html = do_shortcode('[vc_btn' . $btn_atts . '][/vc_btn]');
<?php extract(shortcode_atts(array('title' => '', 'title_align' => '', 'el_width' => '', 'style' => '', 'height' => '', 'color' => '', 'accent_color' => '', 'border_size' => '', 'padding' => '', 'position' => '', 'el_class' => ''), $atts)); $class = "vc_separator wpb_content_element"; $class .= $title_align != '' ? ' vc_' . $title_align : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ' vc_el_width_100'; $class .= $style != '' ? ' vc_sep_' . $style : ''; $class .= $position != '' ? ' vc_sep_position_' . $position : ''; if ($color != '' && 'custom' != $color) { $class .= ' vc_sep_color_' . $color; } $inline_css = 'custom' == $color && $accent_color != '' ? 'style="' . vc_get_css_color('border-color', $accent_color) . ' border-width:' . $border_size . '; height: ' . $height . ';"' : 'style="border-width:' . $border_size . '; height: ' . $height . ';"'; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> " style="padding: <?php echo $padding; ?> ;"> <span class="vc_sep_holder vc_sep_holder_l"><span <?php echo $inline_css; ?> class="vc_sep_line"></span></span> <?php if ($title != '') { ?> <h4><?php echo $title;
<?php extract(shortcode_atts(array('title' => '', 'title_align' => '', 'el_width' => '', 'style' => '', 'color' => '', 'el_class' => ''), $atts)); $class = "vc_separator wpb_content_element"; $class .= $title_align != '' ? ' vc_' . $title_align : ''; $class .= $style != '' ? ' vc_sep_' . $style : ''; $border_color = ' style="' . esc_attr(vc_get_css_color('border-color', $color)) . '"'; $inline_css = ' style="width:' . esc_attr($el_width) . ';"'; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr($css_class); ?> "<?php echo $inline_css; ?> > <span class="vc_sep_holder vc_sep_holder_l"><span<?php echo $border_color; ?> class="vc_sep_line"></span></span> <?php if ($title != '') { ?> <h4><?php echo esc_html($title); ?> </h4><?php } ?>
$atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $el_class = $this->getExtraClass($el_class); $bar_options = ''; $options = explode(",", $options); if (in_array("animated", $options)) { $bar_options .= " animated"; } if (in_array("striped", $options)) { $bar_options .= " striped"; } if ($contextual) { $bar_options .= ' progress-bar-' . $contextual; } if ('custom' === $bgcolor && '' !== $custombgcolor) { $custombgcolor = vc_get_css_color('background-color', $custombgcolor); $bgcolor = ""; } else { $custombgcolor = ''; } if ('' !== $bgcolor) { $bgcolor = " " . $bgcolor; } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_progress_bar wpb_content_element' . $el_class, $this->settings['base'], $atts); $output = '<div class="' . $css_class . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_progress_bar_heading')); $graph_lines = explode(",", $values); $max_value = 0.0; $graph_lines_data = array(); foreach ($graph_lines as $line) { $new_line = array();
<?php $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $el_class = $this->getExtraClass($el_class); $bar_options = ''; $options = explode(",", $options); if (in_array("animated", $options)) { $bar_options .= " animated"; } if (in_array("striped", $options)) { $bar_options .= " striped"; } $bgcolor = ''; if ($color != '') { $bgcolor = ' style="' . esc_attr(vc_get_css_color('background-color', $color)) . '"'; } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_progress_bar wpb_content_element' . $el_class, $this->settings['base'], $atts); if ($css) { $css_class .= vc_shortcode_custom_css_class($css, ' '); } $output = '<div class="' . esc_attr($css_class) . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_progress_bar_heading')); $graph_lines = explode(",", $values); $max_value = 0.0; $graph_lines_data = array(); foreach ($graph_lines as $line) { $new_line = array(); $color_index = 2; $data = explode("|", $line); $new_line['value'] = isset($data[0]) ? $data[0] : 0;
} else { $iconClass = 'fa fa-adjust'; } if ($icon_wrapper) { $icon_html = '<i class="vc_btn3-icon"><span class="vc_btn3-icon-inner ' . esc_attr($iconClass) . '"></span></i>'; } else { $icon_html = '<i class="vc_btn3-icon ' . esc_attr($iconClass) . '"></i>'; } if ($i_align == 'left') { $button_html = $icon_html . ' ' . $button_html; } else { $button_html .= ' ' . $icon_html; } } if ('custom' === $style) { $inline_css = vc_get_css_color('background-color', $custom_background) . vc_get_css_color('color', $custom_text); } else { $button_class .= ' vc_btn3-color-' . $color . ' '; } if ('' != $inline_css) { $inline_css = ' style="' . $inline_css . '"'; } ?> <div class="<?php echo esc_attr(trim($css_class)); ?> vc_btn3-<?php echo esc_attr($align); ?> "><?php if ($use_link) {
} if ($icon_wrapper) { $icon_html = '<i class="vc_btn3-icon"><span class="vc_btn3-icon-inner ' . esc_attr($iconClass) . '"></span></i>'; } else { $icon_html = '<i class="vc_btn3-icon ' . esc_attr($iconClass) . '"></i>'; } if ('left' === $i_align) { $button_html = $icon_html . ' ' . $button_html; } else { $button_html .= ' ' . $icon_html; } } if ('custom' === $style) { $inline_css = vc_get_css_color('background-color', $custom_background) . vc_get_css_color('color', $custom_text); } elseif ('outline-custom' === $style) { $inline_css = vc_get_css_color('border-color', $outline_custom_color) . vc_get_css_color('color', $outline_custom_color); $attributes[] = 'onmouseenter="this.style.borderColor=\'' . $outline_custom_hover_background . '\'; this.style.backgroundColor=\'' . $outline_custom_hover_background . '\'; this.style.color=\'' . $outline_custom_hover_text . '\'"'; $attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"'; } else { $button_class .= ' vc_btn3-color-' . $color . ' '; } if ('' !== $inline_css) { $inline_css = ' style="' . $inline_css . '"'; } $attributes = implode(' ', $attributes); $link = trim($link); // Add link $use_link = strlen($link) > 0 && 'none' !== $link; $link_output = ''; if ($use_link) { $link_output = vc_gitem_create_link_real($atts, $post, 'vc_general vc_btn3 ' . trim($button_class), $title);
/** * @param string $font_color * * @return string */ public function buildStyle($font_color = '') { $style = ''; if (!empty($font_color)) { $style .= vc_get_css_color('color', $font_color); } return empty($style) ? $style : ' style="' . esc_attr($style) . '"'; }
// 'position' => 'cta_align_right', // 'el_class' => '' // ), $atts)); extract(shortcode_atts(array('h2' => '', 'h4' => '', 'position' => '', 'el_width' => '', 'style' => '', 'txt_align' => '', 'accent_color' => '', 'link' => '', 'title' => __('Text on the button', "js_composer"), 'color' => '', 'icon' => '', 'size' => '', 'btn_style' => '', 'el_class' => '', 'css_animation' => '', 'text_color' => ''), $atts)); $class = "vc_call_to_action wpb_content_element"; // $position = 'left'; // $width = '90'; // $style = ''; // $txt_align = 'right'; $link = $link == '||' ? '' : $link; $class .= $position != '' ? ' vc_cta_btn_pos_' . $position : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ''; $class .= $color != '' ? ' vc_cta_' . $color : ''; $class .= $style != '' ? ' vc_cta_' . $style : ''; $class .= $txt_align != '' ? ' vc_txt_align_' . $txt_align : ''; $inline_css = $accent_color != '' ? ' style="' . vc_get_css_color('background-color', $accent_color) . vc_get_css_color('border-color', $accent_color) . vc_get_css_color('color', $text_color) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); $css_class .= $this->getCSSAnimation($css_animation); ?> <div<?php echo $inline_css; ?> class="<?php echo esc_attr(trim($css_class)); ?> wpsm_vca"> <?php if ($link != '' && $position != 'bottom') { echo do_shortcode('[vc_button2 link="' . $link . '" title="' . $title . '" color="' . $color . '" icon="' . $icon . '" size="' . $size . '" style="' . $btn_style . '" el_class="vc_cta_btn"]'); }
* Shortcode class * @var $this WPBakeryShortcode_Vc_Text_Separator */ $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $class = 'vc_separator wpb_content_element'; $class .= '' !== $title_align ? ' vc_' . $title_align : ''; $class .= '' !== $el_width ? ' vc_sep_width_' . $el_width : ' vc_sep_width_100'; $class .= '' !== $style ? ' vc_sep_' . $style : ''; $class .= '' !== $border_width ? ' vc_sep_border_width_' . $border_width : ''; $class .= '' !== $align ? ' vc_sep_pos_' . $align : ''; $class .= 'separator_no_text' === $layout ? ' vc_separator_no_text' : ''; if ('' !== $color && 'custom' !== $color) { $class .= ' vc_sep_color_' . $color; } $inline_css = 'custom' === $color && '' !== $accent_color ? ' style="' . vc_get_css_color('border-color', $accent_color) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> "><span class="vc_sep_holder vc_sep_holder_l"><span<?php echo $inline_css; ?> class="vc_sep_line"></span></span><?php if ('' !== $title && 'separator_no_text' !== $layout) { ?> <h4><?php echo $title;
* @var $css_animation * @var $content - shortcode content * Shortcode class * @var $this WPBakeryShortCode_VC_Cta_button2 */ $h2 = $h4 = $position = $el_class = $el_width = $size = $txt_align = $accent_color = $link = $title = $color = $size = $btn_style = $css_animation = ''; $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $class = 'vc_call_to_action wpb_content_element'; $link = '||' === $link ? '' : $link; $class .= '' !== $position ? ' vc_cta_btn_pos_' . $position : ''; $class .= '' !== $el_width ? ' vc_el_width_' . $el_width : ''; $class .= '' !== $color ? ' vc_cta_' . $color : ''; $class .= '' !== $style ? ' vc_cta_' . $style : ''; $class .= '' !== $txt_align ? ' vc_txt_align_' . $txt_align : ''; $inline_css = '' !== $accent_color ? ' style="' . vc_get_css_color('background-color', $accent_color) . vc_get_css_color('border-color', $accent_color) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); $css_class .= $this->getCSSAnimation($css_animation); ?> <div<?php echo $inline_css; ?> class="<?php echo esc_attr(trim($css_class)); ?> "> <?php if ('' !== $link && 'bottom' !== $position) { echo do_shortcode('[vc_button2 align="' . $position . '" link="' . $link . '" title="' . $title . '" color="' . $color . '" size="' . $size . '" style="' . $btn_style . '" el_class="vc_cta_btn"]'); }
$atts = $this->convertAttributesToNewProgressBar($atts); extract($atts); wp_enqueue_script('waypoints'); $el_class = $this->getExtraClass($el_class); $bar_options = array(); $options = explode(',', $options); if (in_array('animated', $options)) { $bar_options[] = 'animated'; } if (in_array('striped', $options)) { $bar_options[] = 'striped'; } if ('custom' === $bgcolor && '' !== $custombgcolor) { $custombgcolor = ' style="' . vc_get_css_color('background-color', $custombgcolor) . '"'; if ('' !== $customtxtcolor) { $customtxtcolor = ' style="' . vc_get_css_color('color', $customtxtcolor) . '"'; } $bgcolor = ''; } else { $custombgcolor = ''; $customtxtcolor = ''; $bgcolor = 'vc_progress-bar-color-' . esc_attr($bgcolor); $el_class .= ' ' . $bgcolor; } $class_to_filter = 'vc_progress_bar wpb_content_element'; $class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts); $output = '<div class="' . esc_attr($css_class) . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_progress_bar_heading')); $values = (array) vc_param_group_parse_atts($values); $max_value = 0.0;
if ($iconClass) { vc_icon_element_fonts_enqueue($icon_type); $title = '<i class="' . $iconClass . '"></i>' . $title; } } $class .= $title_align != '' ? ' vc_' . $title_align : ''; $class .= $el_width != '' ? ' vc_sep_width_' . $el_width : ' vc_sep_width_100'; $class .= $style != '' ? ' vc_sep_' . $style : ''; $class .= $border_width != '' ? ' vc_sep_border_width_' . $border_width : ''; $class .= $align != '' ? ' vc_sep_pos_' . $align : ''; $class .= $layout != '' ? ' vc_' . $layout : ''; if ($color != '' && 'custom' != $color) { $class .= ' vc_sep_color_' . $color; } $inline_css = 'custom' == $color && $accent_color != '' ? ' style="' . vc_get_css_color('border-color', $accent_color) . '"' : ''; $inline_css_h = 'custom' == $color && $accent_color != '' ? ' style="' . vc_get_css_color('color', $accent_color) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> "> <span class="vc_sep_holder vc_sep_holder_l"><span<?php echo $inline_css; ?> class="vc_sep_line"></span></span> <?php if ($title != '') { ?> <h4<?php
<?php extract(shortcode_atts(array('title' => '', 'title_align' => '', 'el_width' => '', 'style' => '', 'color' => '', 'accent_color' => '', 'margintop' => '20px', 'marginbottom' => '20px', 'el_class' => '', 'heading' => 'h4'), $atts)); $class = "vc_separator wpb_content_element"; //$el_width = "90"; //$style = 'double'; //$title = ''; //$color = 'blue'; $class .= $title_align != '' ? ' vc_' . $title_align : ''; $class .= $el_width != '' ? ' vc_el_width_' . $el_width : ' vc_el_width_100'; $class .= $style != '' ? ' vc_sep_' . $style : ''; $class .= $color != '' ? ' vc_sep_color_' . $color : ''; $inline_css = $accent_color != '' ? ' style="' . vc_get_css_color('border-color', $accent_color) . '"' : ''; $class .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> " style="margin-bottom: <?php echo $marginbottom; ?> ; padding-top: <?php echo $margintop; ?> ;"> <span class="vc_sep_holder vc_sep_holder_l"><span<?php echo $inline_css; ?> class="vc_sep_line"></span></span> <?php
/** * @deprecated and will be removed in 4.9 * * @param string $bg_image * @param string $bg_color * @param string $bg_image_repeat * @param string $font_color * @param string $padding * @param string $margin_bottom * * @return string */ public function buildStyle($bg_image = '', $bg_color = '', $bg_image_repeat = '', $font_color = '', $padding = '', $margin_bottom = '') { _deprecated_function('WPBakeryShortCode_VC_Row::buildStyle', '4.5'); $has_image = false; $style = ''; if ((int) $bg_image > 0 && false !== ($image_url = wp_get_attachment_url($bg_image, 'large'))) { $has_image = true; $style .= 'background-image: url(' . $image_url . ');'; } if (!empty($bg_color)) { $style .= vc_get_css_color('background-color', $bg_color); } if (!empty($bg_image_repeat) && $has_image) { if ('cover' === $bg_image_repeat) { $style .= 'background-repeat:no-repeat;background-size: cover;'; } elseif ('contain' === $bg_image_repeat) { $style .= 'background-repeat:no-repeat;background-size: contain;'; } elseif ('no-repeat' === $bg_image_repeat) { $style .= 'background-repeat: no-repeat;'; } } if (!empty($font_color)) { $style .= vc_get_css_color('color', $font_color); } if ('' !== $padding) { $style .= 'padding: ' . (preg_match('/(px|em|\\%|pt|cm)$/', $padding) ? $padding : $padding . 'px') . ';'; } if ('' !== $margin_bottom) { $style .= 'margin-bottom: ' . (preg_match('/(px|em|\\%|pt|cm)$/', $margin_bottom) ? $margin_bottom : $margin_bottom . 'px') . ';'; } return empty($style) ? '' : ' style="' . esc_attr($style) . '"'; }
<?php $output = $title = $values = $units = $bgcolor = $custombgcolor = $options = $el_class = ''; extract(shortcode_atts(array('title' => '', 'values' => '', 'units' => '', 'bgcolor' => 'bar_grey', 'custombgcolor' => '', 'options' => '', 'el_class' => ''), $atts)); wp_enqueue_script('waypoints'); $el_class = $this->getExtraClass($el_class); $bar_options = ''; $options = explode(",", $options); if (in_array("animated", $options)) { $bar_options .= " animated"; } if (in_array("striped", $options)) { $bar_options .= " striped"; } if ($bgcolor == "custom" && $custombgcolor != '') { $custombgcolor = ' style="' . vc_get_css_color('background-color', $custombgcolor) . '"'; $bgcolor = ""; } if ($bgcolor != "") { $bgcolor = " " . $bgcolor; } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_progress_bar wpb_content_element' . $el_class, $this->settings['base'], $atts); $output = '<div class="' . $css_class . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_progress_bar_heading')); $graph_lines = explode(",", $values); $max_value = 0.0; $graph_lines_data = array(); foreach ($graph_lines as $line) { $new_line = array(); $color_index = 2; $data = explode("|", $line);
public static function shortcode_before_inner($output, $atts, $content) { // Extract shortcode attributes extract(shortcode_atts(array('row_custom_id' => '', 'row_parallax_style' => 'parallax-none', 'row_parallax_ratio' => '0.5', 'row_bg_color' => '', 'row_bg_image' => '', 'row_bg_repeat' => '', 'row_bg_position' => '', 'row_bg_size' => '', 'row_bg_att' => '', 'row_video_url' => '', 'row_overlay_color' => '', 'row_enable_v_center' => '', 'row_full_height' => '', 'row_offsets' => ''), $atts)); $style = ''; if ('' != $row_bg_color) { $style .= vc_get_css_color('background-color', $row_bg_color); } $url = ''; if ('' != $row_bg_image) { // Get image $url = wp_get_attachment_image_src($row_bg_image, 'full'); $style .= 'background-image: url(' . $url[0] . ');'; $style .= 'background-repeat: ' . $row_bg_repeat . ';'; $style .= 'background-position: ' . $row_bg_position . ';'; $style .= 'background-size: ' . $row_bg_size . ';'; $style .= 'background-attachment: ' . $row_bg_att . ';'; } $overlay = ''; if ('' != $row_overlay_color) { $overlay = '<div class="row-overlay" style="' . vc_get_css_color('background-color', $row_overlay_color) . '"></div>'; } $video = ' <div class="ivan-bg-video"> <div class="ivan-bg-video-inner"></div> ' . $overlay . ' </div>'; if ('' != $row_video_url) { $row_video_url = str_replace('.mp4', '', $row_video_url); $row_video_url = str_replace('.webm', '', $row_video_url); $video = ' <div class="ivan-bg-video"> <div class="ivan-bg-video-inner"> <video muted loop autoplay="autoplay"> <source type="video/mp4" src="' . $row_video_url . '.mp4" /> <source type="video/webm" src="' . $row_video_url . '.webm" /> </video> </div> ' . $overlay . ' </div>'; } $ratio = ''; if ('parallax-vertical' == $row_parallax_style) { $ratio = 'data-stellar-background-ratio="' . $row_parallax_ratio . '"'; } $row_parallax_style = ' ' . $row_parallax_style; // Viewport Height $offset = ''; $viewportHeight = ''; if ('yes' == $row_full_height) { $viewportHeight = ' iv-full-viewport'; if ('' != $row_offsets) { $offset = ' data-offset="' . $row_offsets . '"'; } } // Reset V-Center when at Admin if (is_admin() && ' v-center' == $row_enable_v_center) { $row_enable_v_center = ' composer-v-center'; } $output = '<div id="' . $row_custom_id . '" class="ivan-custom-wrapper ' . $row_enable_v_center . $row_parallax_style . $viewportHeight . '" ' . $ratio . ' style="' . $style . '"' . $offset . '>' . $video; return $output; }