PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / includes / avada-widgets / property-actions-shortcode.php

property-actions-shortcode.php in Property Hive 2.3.0, at includes/avada-widgets/property-actions-shortcode.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7
8 add_shortcode( 'avada_property_actions', function( $atts ) {
9 $atts = shortcode_atts( array(
10
11 ), $atts );
12
13 if ( get_post_type( get_the_ID() ) != 'property' )
14 {
15 return '';
16 }
17
18 fusion_element_rendering_elements( true );
19
20 global $property;
21
22 if ( empty($property) )
23 {
24 // 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.
25 $property = new PH_Property(get_the_ID());
26 }
27
28 ob_start();
29
30 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- FusionBuilder::attributes() returns the complete HTML attribute fragment and escapes each attribute name and value.
31 echo '<div ' . FusionBuilder::attributes( 'property-actions-shortcode' ) . '>';
32 propertyhive_template_single_actions();
33 echo '</div>';
34
35 $html = ob_get_clean();
36
37 fusion_element_rendering_elements( false );
38
39 return $html;
40 });