| 1 |
<?php |
| 2 |
|
| 3 |
add_shortcode( 'avada_property_images', function( $atts ) { |
| 4 |
$atts = shortcode_atts( array( |
| 5 |
'hide_thumbnails' => '', |
| 6 |
), $atts ); |
| 7 |
|
| 8 |
if ( get_post_type( get_the_ID() ) != 'property' ) |
| 9 |
{ |
| 10 |
return ''; |
| 11 |
} |
| 12 |
|
| 13 |
fusion_element_rendering_elements( true ); |
| 14 |
|
| 15 |
global $property; |
| 16 |
|
| 17 |
if ( empty($property) ) |
| 18 |
{ |
| 19 |
$property = new PH_Property(get_the_ID()); |
| 20 |
} |
| 21 |
|
| 22 |
ob_start(); |
| 23 |
|
| 24 |
/*$suffix = ''; |
| 25 |
$assets_path = str_replace( array( 'http:', 'https:' ), '', PH()->plugin_url() ) . '/assets/'; |
| 26 |
|
| 27 |
wp_enqueue_script( 'flexslider', $assets_path . 'js/flexslider/jquery.flexslider' . $suffix . '.js', array( 'jquery' ), '2.7.2', true ); |
| 28 |
wp_enqueue_script( 'flexslider-init', $assets_path . 'js/flexslider/jquery.flexslider.init' . $suffix . '.js', array( 'jquery','flexslider' ), PH_VERSION, true ); |
| 29 |
wp_enqueue_style( 'flexslider_css', $assets_path . 'css/flexslider.css', array(), '2.7.2' ); |
| 30 |
*/ |
| 31 |
if ( 'yes' === $atts['hide_thumbnails'] ) |
| 32 |
{ |
| 33 |
remove_action( 'propertyhive_product_thumbnails', 'propertyhive_show_property_thumbnails', 20 ); |
| 34 |
} |
| 35 |
|
| 36 |
//wp_enqueue_script( 'propertyhive_fancybox' ); |
| 37 |
//wp_enqueue_style( 'propertyhive_fancybox_css' ); |
| 38 |
|
| 39 |
propertyhive_show_property_images(); |
| 40 |
|
| 41 |
$html = ob_get_clean(); |
| 42 |
|
| 43 |
fusion_element_rendering_elements( false ); |
| 44 |
|
| 45 |
return $html; |
| 46 |
}); |