Add hide virtual tour setting.

This commit is contained in:
Hoang Huu 2019-09-26 15:43:47 +07:00
parent ab83165eb7
commit 7630299415
5 changed files with 37 additions and 11 deletions

View File

@ -346,6 +346,17 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
],
];
$fields[] = [
'name' => esc_html__( 'Show Virtual Tour tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Virtual Tour tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_virtual_tour',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Map tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Map tab in the single property page.', 'opalestate-pro' ),

View File

@ -140,6 +140,7 @@ class Opalestate_Property {
'attachments',
'facilities',
'video',
'virtual_tour',
'map',
'nearby',
'walkscores',

View File

@ -2,9 +2,13 @@
global $property;
$infos = $property->get_meta_fullinfo();
$taxs = $property->get_types_tax();
$taxs = $property->get_types_tax();
if ( ! $infos && ! $taxs ) {
return;
}
?>
<div class="property-information box-inner-summary">
<h5><?php esc_html_e( 'Quick Information', 'opalestate-pro' ); ?></h5>
<div class="box-content">
@ -33,4 +37,4 @@ $taxs = $property->get_types_tax();
<?php endif; ?>
</ul>
</div>
</div>
</div>

View File

@ -5,15 +5,18 @@ if ( ! $property->get_block_setting( 'video' ) ) {
return;
}
$videoURL = $property->get_video_url();
$video_url = $property->get_video_url();
if ( ! $video_url ) {
return;
}
?>
<?php if ( $videoURL ) : ?>
<div class="opalestate-box-content property-video-session">
<h4 class="outbox-title" id="block-video"><?php esc_html_e( 'Video', 'opalestate-pro' ); ?></h4>
<div class="opalestate-box">
<div class="box-info">
<?php echo wp_oembed_get( $videoURL ); ?>
<?php echo wp_oembed_get( $video_url ); ?>
</div>
</div>
</div>
<?php endif; ?>

View File

@ -1,15 +1,22 @@
<?php
global $property;
$virtualTour = $property->get_virtual_tour();
if ( ! $property->get_block_setting( 'virtual_tour' ) ) {
return;
}
$virtual_tour = $property->get_virtual_tour();
if ( ! $virtual_tour ) {
return;
}
?>
<?php if( $virtualTour ) : ?>
<div class="opalestate-box-content property-360-virtual-session">
<h4 class="outbox-title" id="block-tour360"><?php esc_html_e( '360° Virtual Tour', 'opalestate-pro' ); ?></h4>
<h4 class="outbox-title" id="block-tour360"><?php esc_html_e( '360° Virtual Tour', 'opalestate-pro' ); ?></h4>
<div class=" opalestate-box">
<div class="box-info">
<?php echo do_shortcode( $virtualTour ); ?>
<?php echo do_shortcode( $virtual_tour ); ?>
</div>
</div>
</div>
<?php endif; ?>