| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 4 |
|
| 5 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 6 |
$css = ''; |
| 7 |
|
| 8 |
extract(shortcode_atts(array( |
| 9 |
"css" => "", |
| 10 |
"font_container" => "", |
| 11 |
), $atts)); |
| 12 |
|
| 13 |
global $property; |
| 14 |
|
| 15 |
if ( !isset($property->id) ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
if ( $property->bathrooms == '' || $property->bathrooms == '0' ) { |
| 20 |
return; |
| 21 |
} |
| 22 |
|
| 23 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery/Visual Composer framework filter constant; the integration requires the framework hook name unchanged. WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 24 |
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts ); |
| 25 |
|
| 26 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 27 |
$style = ''; |
| 28 |
if ( ! empty( $atts['font_container'] ) && isset($atts['font_container']) ) |
| 29 |
{ |
| 30 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 31 |
$style = ph_extract_font_style_from_salient_font_container( $font_container ); |
| 32 |
} |
| 33 |
|
| 34 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The style fragment is built by ph_extract_font_style_from_salient_font_container() using safecss_filter_attr() and esc_attr(). |
| 35 |
echo '<div class="' . esc_attr( $css_class ) . '" ' . $style . '>'; |
| 36 |
|
| 37 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 38 |
$label = __( 'Brochure', 'propertyhive' ); |
| 39 |
|
| 40 |
if ( get_option('propertyhive_brochures_stored_as', '') == 'urls' ) |
| 41 |
{ |
| 42 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 43 |
$brochure_urls = $property->brochure_urls; |
| 44 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 45 |
if ( !is_array($brochure_urls) ) { $brochure_urls = array(); } |
| 46 |
|
| 47 |
if ( !empty($brochure_urls) ) |
| 48 |
{ |
| 49 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 50 |
foreach ( $brochure_urls as $brochure ) |
| 51 |
{ |
| 52 |
echo '<a href="' . esc_url($brochure['url']) . '" target="_blank" rel="nofollow">' . esc_html($label) . '</a>'; |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
else |
| 57 |
{ |
| 58 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 59 |
$brochure_attachment_ids = $property->get_brochure_attachment_ids(); |
| 60 |
|
| 61 |
if ( !empty($brochure_attachment_ids) ) |
| 62 |
{ |
| 63 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. |
| 64 |
foreach ( $brochure_attachment_ids as $attachment_id ) |
| 65 |
{ |
| 66 |
echo '<a href="' . esc_url(wp_get_attachment_url($attachment_id)) . '" target="_blank" rel="nofollow">' . esc_html($label) . '</a>'; |
| 67 |
} |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
echo '</div>'; |
| 72 |
|