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(); ?>
Warning: Please add SSL to enable Gyroscope for WP VR.
'); die(); } $gyro = true; $deviceorientationcontrol = $this->format->set_checkbox_value(@wp_unslash( $_POST['deviceorientationcontrol'] )); } else { $gyro = false; $deviceorientationcontrol = false; } //===Gyroscopre control===// $autoload = $this->format->set_checkbox_value(isset($_POST['autoload']) ? wp_unslash( $_POST['autoload'] ) : ''); $control = $this->format->set_checkbox_value(isset($_POST['control']) ? wp_unslash( $_POST['control'] ) : ''); $scene_fade_duration = isset($_POST['scenefadeduration']) ? sanitize_text_field(wp_unslash( $_POST['scenefadeduration'] )) : ''; $preview = isset($_POST['preview']) ? esc_url(wp_unslash( $_POST['preview'] )) : ''; $rotation = isset($_POST['rotation']) ? sanitize_text_field(wp_unslash( $_POST['rotation'] )) : ''; $autorotation = isset($_POST['autorotation']) ? sanitize_text_field(wp_unslash( $_POST['autorotation'] )) : ''; $autorotationinactivedelay = isset($_POST['autorotationinactivedelay']) ? sanitize_text_field(wp_unslash( $_POST['autorotationinactivedelay'] )) : ''; $autorotationstopdelay = isset($_POST['autorotationstopdelay']) ? sanitize_text_field(wp_unslash( $_POST['autorotationstopdelay'] )) : ''; //===generic form===// $genericform = sanitize_text_field(isset($_POST['genericform']) ? wp_unslash( $_POST['genericform'] ) : 'off'); $genericformshortcode = isset($_POST['genericformshortcode']) ? sanitize_text_field(wp_unslash( $_POST['genericformshortcode'] )) : '' ; //===generic form===// if(isset($_POST['rotation']) && sanitize_text_field(wp_unslash( $_POST['rotation'] )) === 'on' ) { $this->validator->basic_setting_validation($autorotationinactivedelay, $autorotationstopdelay); // Basic setting error control and validation // } //===Company Logo===// $cpLogoSwitch = isset($_POST['cpLogoSwitch']) ? wp_unslash( $_POST['cpLogoSwitch'] ) : 'off'; $cpLogoImg = isset($_POST['cpLogoImg']) ? wp_unslash( $_POST['cpLogoImg'] ) : ''; $cpLogoContent = isset($_POST['cpLogoContent']) ? sanitize_text_field(wp_unslash( $_POST['cpLogoContent'] )) : ''; //===Company Logo===// //===Explainer video===// $explainerSwitch = isset($_POST['explainerSwitch']) ? wp_unslash( $_POST['explainerSwitch'] ) : 'off'; $explainerContent = ''; $explainerContent = isset($_POST['explainerContent']) ? wp_unslash( $_POST['explainerContent'] ) : ''; //===Explainer video===// $scene_fade_duration = ''; $scene_fade_duration = isset($_POST['scenefadeduration']) ? sanitize_text_field(wp_unslash( $_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(wp_unslash( $_POST['bg_music'] )) : 'off'; $bg_music_url = isset($_POST['bg_music_url']) ? esc_url_raw(wp_unslash( $_POST['bg_music_url'] )) : ''; $autoplay_bg_music = isset($_POST['autoplay_bg_music']) ? sanitize_text_field(wp_unslash( $_POST['autoplay_bg_music'] )) : 'off'; $loop_bg_music = isset($_POST['loop_bg_music']) ? sanitize_text_field(wp_unslash( $_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