本文整理汇总了PHP中vc_get_css_color函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_get_css_color函数的具体用法?PHP vc_get_css_color怎么用?PHP vc_get_css_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_get_css_color函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildStyle
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 . '"';
}
示例2: vc_get_css_color
}
}
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) . '"';
}
示例3: vc_map_get_attributes
$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);
示例4: vc_column_offset_class_merge
}
}
}
$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;
示例5: vc_get_css_color
$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);
?>
示例6: getHeading
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 '';
}
示例7: extract
<?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";
示例8: extract
<?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
示例9: vc_get_css_color
$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]');
示例10: extract
<?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;
示例11: extract
<?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
}
?>
示例12: vc_map_get_attributes
$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();
示例13: vc_map_get_attributes
<?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;
示例14: esc_attr
} 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) {
示例15: esc_attr
}
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);