| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 4 |
|
| 5 |
$css = ''; |
| 6 |
|
| 7 |
extract(shortcode_atts(array( |
| 8 |
"display" => "", |
| 9 |
"button_background_color" => "#000", |
| 10 |
"button_text_color" => "#FFF", |
| 11 |
"css" => "", |
| 12 |
"font_container" => "", |
| 13 |
), $atts)); |
| 14 |
|
| 15 |
global $property; |
| 16 |
|
| 17 |
if ( !isset($property->id) ) { |
| 18 |
return; |
| 19 |
} |
| 20 |
|
| 21 |
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts ); |
| 22 |
|
| 23 |
$style = ''; |
| 24 |
if ( ! empty( $atts['font_container'] ) && isset($atts['font_container']) ) |
| 25 |
{ |
| 26 |
$style = ph_extract_font_style_from_salient_font_container( $font_container ); |
| 27 |
} |
| 28 |
|
| 29 |
echo '<div class="' . esc_attr( $css_class ) . '" ' . $style . '>'; |
| 30 |
|
| 31 |
if ( isset($atts['display']) && $atts['display'] == 'buttons' ) |
| 32 |
{ |
| 33 |
echo '<style type="text/css">'; |
| 34 |
echo '.property_actions ul { list-style-type:none; margin:0; padding:0; }'; |
| 35 |
echo '.property_actions ul li { display:inline-block; margin-right:5px; }'; |
| 36 |
echo '.property_actions ul li a { display:block; padding:7px 17px; text-decoration:none; background:' . esc_attr($atts['button_background_color']) . '; color:' . esc_attr($atts['button_text_color']) . ' }'; |
| 37 |
echo '</style>'; |
| 38 |
} |
| 39 |
|
| 40 |
propertyhive_template_single_actions(); |
| 41 |
|
| 42 |
echo '</div>'; |