hotspot = new WPVR_Hotspot(); $this->format = new WPVR_Format(); $this->validator = new WPVR_Validator(); $this->status = apply_filters( 'check_pro_license_status', $this->status ); if ($this->status !== false && $this->status == 'valid') { $this->data_limit = 999999999; } else { $this->data_limit = 5; } } /** * Render Scene Settings Content * * @param array $postdata * * @return void * @since 8.0.0 */ public function render_scene($postdata) { ob_start(); ?>
render_scene_repeater_list($postdata); ?>
render_default_repeater_item(); ?>
render_repeater_item_with_panodata($pano_scene, $s); ?>

render_default_repeater_item_scene_content(); ?>
hotspot->render_hotspot($s = 0, $h =1)?>

render_repeater_scene_content_with_data($pano_scene); ?>
render_repeater_item_hotspot_content($pano_scene, $s); ?>
hotspot->render_hotspot_with_panodata($pano_scene['hotspot-list'], $s); //Render hotspot while scene has hotspot data ?>
hotspot->render_hotspot($s, $h = 1); //Render hotspot while scene has no hotspot data ?>
format->prepare_panodata(isset($_POST['panodata']) ? $_POST['panodata'] : ''); $default_scene = $this->format->prepare_default_scene($panodata); $previewtext = isset($_POST['previewtext']) ? $this->validator->preview_text_validation($_POST['previewtext']) : ''; $gzoom = $this->format->set_pro_checkbox_value(@$_POST['gzoom']); $default_global_zoom = ''; $max_global_zoom = ''; $min_global_zoom = ''; if ($gzoom == 'on') { $default_global_zoom = isset($_POST['dzoom']) ? $_POST['dzoom'] : ''; $max_global_zoom = isset($_POST['maxzoom']) ? $_POST['maxzoom'] : ''; $min_global_zoom = isset($_POST['minzoom']) ? $_POST['minzoom'] : ''; } $custom_control = isset($_POST['customcontrol']) ? $_POST['customcontrol'] : null; $vrgallery = $this->format->set_checkbox_value(@$_POST['vrgallery']); $vrgallery_title = $this->format->set_checkbox_value(@$_POST['vrgallery_title']); $vrgallery_display = $this->format->set_checkbox_value(@$_POST['vrgallery_display']); $vrgallery_icon_size = $this->format->set_checkbox_value(@$_POST['vrgallery_icon_size']); $mouseZoom = $this->format->set_pro_checkbox_value(@$_POST['mouseZoom']); $draggable = $this->format->set_pro_checkbox_value(@$_POST['draggable']); $diskeyboard = $this->format->set_pro_checkbox_value(@$_POST['diskeyboard']); $keyboardzoom = $this->format->set_checkbox_value(@$_POST['keyboardzoom']); $compass = $this->format->set_checkbox_on_value(@$_POST['compass']); //===Gyroscopre control===// $gyro = $this->format->set_pro_checkbox_value(@$_POST['gyro']); if ($gyro == 'on') { if (!is_ssl()) { wp_send_json_error('

Warning: Please add SSL to enable Gyroscope for WP VR.

'); die(); } $gyro = true; $deviceorientationcontrol = $this->format->set_checkbox_value(@$_POST['deviceorientationcontrol']); } else { $gyro = false; $deviceorientationcontrol = false; } //===Gyroscopre control===// $autoload = $this->format->set_checkbox_value(isset($_POST['autoload']) ? $_POST['autoload'] : ''); $control = $this->format->set_checkbox_value(isset($_POST['control']) ? $_POST['control'] : ''); $scene_fade_duration = isset($_POST['scenefadeduration']) ? sanitize_text_field($_POST['scenefadeduration']) : ''; $preview = isset($_POST['preview']) ? esc_url($_POST['preview']) : ''; $rotation = isset($_POST['rotation']) ? sanitize_text_field($_POST['rotation']) : ''; $autorotation = isset($_POST['autorotation']) ? sanitize_text_field($_POST['autorotation']) : ''; $autorotationinactivedelay = isset($_POST['autorotationinactivedelay']) ? sanitize_text_field($_POST['autorotationinactivedelay']) : ''; $autorotationstopdelay = isset($_POST['autorotationstopdelay']) ? sanitize_text_field($_POST['autorotationstopdelay']) : ''; //===generic form===// $genericform = sanitize_text_field(isset($_POST['genericform']) ? $_POST['genericform'] : 'off'); $genericformshortcode = isset($_POST['genericformshortcode']) ? sanitize_text_field($_POST['genericformshortcode']) : '' ; //===generic form===// if(isset($_POST['rotation']) && sanitize_text_field($_POST['rotation']) === 'on' ) { $this->validator->basic_setting_validation($autorotationinactivedelay, $autorotationstopdelay); // Basic setting error control and validation // } //===Company Logo===// $cpLogoSwitch = isset($_POST['cpLogoSwitch']) ? $_POST['cpLogoSwitch'] : 'off'; $cpLogoImg = isset($_POST['cpLogoImg']) ? $_POST['cpLogoImg'] : ''; $cpLogoContent = isset($_POST['cpLogoContent']) ? sanitize_text_field($_POST['cpLogoContent']) : ''; //===Company Logo===// //===Explainer video===// $explainerSwitch = isset($_POST['explainerSwitch']) ? $_POST['explainerSwitch'] : 'off'; $explainerContent = ''; $explainerContent = isset($_POST['explainerContent']) ? $_POST['explainerContent'] : ''; //===Explainer video===// $scene_fade_duration = ''; $scene_fade_duration = isset($_POST['scenefadeduration']) ? sanitize_text_field($_POST['scenefadeduration']) : ''; // Only validate when publishing, not when saving drafts if ($is_publish_action) { $this->validator->scene_validation($panodata); // Scene content error control and validation // $this->validator->empty_scene_validation($panodata); // Empty scene content error control and validation // $this->validator->duplicate_hotspot_validation($panodata); // Duplicate error control and validation // } $panodata = $this->format->remove_empty_scene_and_hotspot($panodata); // Remove Empty scene and hotspot // //===audio===// $bg_music = isset($_POST['bg_music']) ? sanitize_text_field($_POST['bg_music']) : 'off'; $bg_music_url = isset($_POST['bg_music_url']) ? esc_url_raw($_POST['bg_music_url']) : ''; $autoplay_bg_music = isset($_POST['autoplay_bg_music']) ? sanitize_text_field($_POST['autoplay_bg_music']) : 'off'; $loop_bg_music = isset($_POST['loop_bg_music']) ? sanitize_text_field($_POST['loop_bg_music']) : 'off'; if ($bg_music == 'on') { if (empty($bg_music_url)) { wp_send_json_error('

Warning: Please add an audio file as you enabled audio for this tour

'); die(); } } //===audio===// $advanced_control = array( 'keyboardzoom' => $keyboardzoom, 'diskeyboard' => $diskeyboard, 'draggable' => $draggable, 'mouseZoom' => $mouseZoom, 'gyro' => $gyro, 'deviceorientationcontrol' => $deviceorientationcontrol, 'compass' => $compass, 'vrgallery' => $vrgallery, 'vrgallery_title' => $vrgallery_title, 'vrgallery_display' => $vrgallery_display, 'vrgallery_icon_size' => $vrgallery_icon_size, 'bg_music' => $bg_music, 'bg_music_url' => $bg_music_url, 'autoplay_bg_music' => $autoplay_bg_music, 'loop_bg_music' => $loop_bg_music, 'cpLogoSwitch' => $cpLogoSwitch, 'cpLogoImg' => $cpLogoImg, 'cpLogoContent' => $cpLogoContent, 'hfov' => $default_global_zoom, 'maxHfov' => $max_global_zoom, 'minHfov' => $min_global_zoom, 'explainerSwitch' => $explainerSwitch, 'explainerContent' => $explainerContent, ); $pano_array = array(); $pano_array = array( "panoid" => $panoid, "autoLoad" => $autoload, "showControls" => $control, "customcontrol" => $custom_control, "autoRotate" => $autorotation, "autoRotateInactivityDelay" => $autorotationinactivedelay, "autoRotateStopDelay" => $autorotationstopdelay, "genericform" => $genericform, "genericformshortcode" => $genericformshortcode, "preview" => $preview, "defaultscene" => $default_scene, "scenefadeduration" => $scene_fade_duration, "panodata" => $panodata, "previewtext" => $previewtext); $pano_array = apply_filters( 'prepare_scene_pano_array_with_pro_version', $pano_array, $_POST, $advanced_control ); $pano_array = $this->format->prepare_rotation_wrapper_data($pano_array, $rotation); // Prepare tour rotation wrapper data / update_post_meta($postid, 'panodata', $pano_array); do_action( 'wpvr_hotspot_saved', $postid, $pano_array ); $response = array( 'success' => true, 'data' => array( 'post_ID' => $postid, 'post_status' => get_post_status($postid) ) ); do_action( 'wpvr_tour_settings_saved', $postid ); /** * Delete orphaned analytics data * * @param integer $postid POST ID * * @return void * @since 8.5.16 */ do_action('wpvr_pro_delete_orphaned_analytics_data', $postid); wp_send_json($response); die(); } /** * Allow iframe but disallow script tags in user input * @since 8.5.16 */ public function wpvr_sanitize_iframe_only( $input ) { // Start with standard allowed post HTML (p, a, strong, etc.) $allowed_tags = wp_kses_allowed_html( 'post' ); // Explicitly allow