| 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 |
}); |