|
Server IP : 10.131.40.8 / Your IP : 216.73.216.37 Web Server : Apache System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : ludmqhh ( 137773) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/l/u/d/ludmqhh/www/hotel-forum/wp-content/themes/hotello/vc_templates/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* @var $content
* @var $link
* @var $button_color
* @var $button_custom_color
* @var $button_custom_color_hover
* @var $button_style
* @var $button_icon_pos
* @var $button_icon
*/
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
$classes = array('stm_cta');
$classes[] = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css, ' '));
$classes[] = $this->getCSSAnimation($css_animation);
$classes[] = $style;
$icon_classes = array(
'btn__icon mtc icon_' . intval($button_icon_size) . 'px ' . $button_icon
);
$button_unique_class = uniqid('btn_');
$style_array = array();
$style_array_hover = array();
$style_string = '';
$icon_style_array = array();
$icon_style_array_hover = array();
$link = vc_build_link($link);
$button_classes = array(
'btn',
'btn_' . $button_style,
$button_size,
$button_unique_class
);
if (!empty($button_icon_pos)) {
$button_classes[] = 'btn_icon btn_icon-' . $button_icon_pos;
}
if ($button_color !== 'custom') {
$button_classes[] = 'btn_' . $button_color;
} else {
$style_array[$button_unique_class] = array();
$style_array_hover[$button_unique_class] = array();
if (!empty($button_custom_color)) {
$style_array[$button_unique_class]['background-color'] = $button_custom_color;
}
if (!empty($button_custom_border_color)) {
$style_array[$button_unique_class]['border-color'] = $button_custom_border_color;
}
if (!empty($button_custom_color_hover)) {
$style_array_hover[$button_unique_class]['background-color'] = $button_custom_color_hover;
}
if (!empty($button_custom_border_color_hover)) {
$style_array_hover[$button_unique_class]['border-color'] = $button_custom_border_color_hover;
}
if (!empty($icon_custom_color)) {
$icon_style_array['color'] = $icon_custom_color;
}
if (!empty($icon_custom_color_hover)) {
$icon_style_array_hover['color'] = $icon_custom_color_hover;
}
if (!empty($button_custom_text_color)) {
$style_array[$button_unique_class]['color'] = $button_custom_text_color;
}
if (!empty($button_custom_text_color_hover)) {
$style_array_hover[$button_unique_class]['color'] = $button_custom_text_color_hover;
}
}
if (!empty($style_array)) {
foreach ($style_array as $el => $css) {
$style_string .= '.' . $el . ':not(.btn_white) {';
$style_string .= hotello_array_to_style_string($css, true);
$style_string .= '}';
}
}
if (!empty($style_array_hover)) {
foreach ($style_array_hover as $el => $css) {
$style_string .= '.btn.' . $el . ':hover{';
$style_string .= hotello_array_to_style_string($css, true);
$style_string .= '}';
}
}
if (!empty($icon_style_array)) {
$style_string .= '.btn i {';
$style_string .= hotello_array_to_style_string($icon_style_array, true);
$style_string .= '}';
}
if (!empty($icon_style_array_hover)) {
$style_string .= '.btn:hover i {';
$style_string .= hotello_array_to_style_string($icon_style_array_hover, true);
$style_string .= '}';
}
hotello_add_element_style('cta', $style, $style_string);
?>
<div class="<?php echo esc_attr(implode(' ', $classes)); ?>">
<?php if (!empty($content)): ?>
<div class="stm_cta__content">
<?php echo wpb_js_remove_wpautop($content, true); ?>
</div>
<?php endif; ?>
<?php if(!empty($phone)): ?>
<?php echo "<span>"; ?>
<i class="fa fa-phone"></i>
<?php echo sanitize_text_field($phone); ?>
<?php echo "</span>"; ?>
<?php endif; ?>
<?php if(!empty($email)): ?>
<?php echo "<span>"; ?>
<i class="fa fa-envelope"></i>
<?php echo sanitize_text_field($email); ?>
<?php echo "</span>"; ?>
<?php endif; ?>
<?php if (!empty($link)):
$target = (empty($link['target'])) ? '_self' : $link['target']; ?>
<div class="stm_cta__link">
<a href="<?php echo esc_url($link['url']); ?>"
class="<?php echo esc_attr(implode(' ', $button_classes)); ?>"
title="<?php echo esc_attr($link['title']); ?>"
target="<?php echo esc_attr($target); ?>">
<?php
if (!empty($button_icon_pos)) : ?>
<i class="<?php echo esc_attr(implode(' ', $icon_classes)); ?>"></i>
<?php endif; ?>
<?php echo sanitize_text_field($link['title']); ?>
</a>
</div>
<?php endif; ?>
</div>
