← All changes
|
includes/avada-widgets/property-embedded-virtual-tours-shortcode.php
+8
-1
2.2.3
→
2.4.0
View file →
| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit; | |
| 5 | +} | |
| 6 | + | |
| 7 | + | |
| 3 | 8 | add_shortcode( 'avada_property_embedded_virtual_tours', function( $atts ) { |
| 4 | 9 | $atts = shortcode_atts( array( |
| 5 | 10 | 'show_title' => '', |
| 6 | 11 | 'oembed' => '', |
| @@ -16,8 +21,9 @@ | ||
| 16 | 21 | global $property; |
| 17 | 22 | |
| 18 | 23 | if ( empty($property) ) |
| 19 | 24 | { |
| 25 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Shared frontend property global used by the Avada shortcode contract; changing $property would break the existing property context passed to these widgets. | |
| 20 | 26 | $property = new PH_Property(get_the_ID()); |
| 21 | 27 | } |
| 22 | 28 | |
| 23 | 29 | ob_start(); |
| @@ -34,8 +40,9 @@ | ||
| 34 | 40 | { |
| 35 | 41 | if ( isset($atts['oembed']) && $atts['oembed'] == 'yes' ) |
| 36 | 42 | { |
| 37 | 43 | $embed_code = wp_oembed_get($virtual_tour['url']); |
| 44 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_oembed_get() uses WordPress provider trust and sanitization; preserve supported provider scripts and trusted PHP filters. | |
| 38 | 45 | echo $embed_code; |
| 39 | 46 | } |
| 40 | 47 | else |
| 41 | 48 | { |
| @@ -68,5 +75,5 @@ | ||
| 68 | 75 | |
| 69 | 76 | fusion_element_rendering_elements( false ); |
| 70 | 77 | |
| 71 | 78 | return $html; |
| 72 | -}); | |
| 79 | +}); | |