PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.2.0
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.2.0
9.2.0 9.1.4 9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 All 224 releases
← All changes | src/Admin/Admin.php +73 -3 9.1.1 → 9.2.0 View file →
@@ -216,11 +216,67 @@
216 216 if ( class_exists( 'Wpvr_fontawesome_icons' ) ) {
217 217 $fa_icons = ( new \Wpvr_fontawesome_icons() )->icon;
218 218 }
219 219
220 + $raw_hotspot_types = apply_filters( 'wpvr_hotspot_types', [
221 + 'info' => __( 'Info', 'wpvr' ),
222 + 'scene' => __( 'Scene', 'wpvr' ),
223 + ] );
224 +
225 + $hotspot_types = [];
226 + if ( isset( $raw_hotspot_types['info'] ) ) {
227 + $hotspot_types[] = [ 'value' => 'info', 'label' => $raw_hotspot_types['info'] ];
228 + unset( $raw_hotspot_types['info'] );
229 + } else {
230 + $hotspot_types[] = [ 'value' => 'info', 'label' => __( 'Info', 'wpvr' ) ];
231 + }
232 +
233 + if ( isset( $raw_hotspot_types['scene'] ) ) {
234 + $hotspot_types[] = [ 'value' => 'scene', 'label' => $raw_hotspot_types['scene'] ];
235 + unset( $raw_hotspot_types['scene'] );
236 + } else {
237 + $hotspot_types[] = [ 'value' => 'scene', 'label' => __( 'Scene', 'wpvr' ) ];
238 + }
239 +
240 + $hotspot_types[] = [ 'value' => 'url', 'label' => __( 'External URL', 'wpvr' ) ];
241 + if ( isset( $raw_hotspot_types['url'] ) ) {
242 + unset( $raw_hotspot_types['url'] );
243 + }
244 +
245 + foreach ( $raw_hotspot_types as $type_key => $type_label ) {
246 + $hotspot_types[] = [ 'value' => $type_key, 'label' => $type_label ];
247 + }
248 +
249 + $fluent_forms = [];
250 + if ( defined( 'FLUENTFORM' ) ) {
251 + global $wpdb;
252 + $fluent_form_table = $wpdb->prefix . 'fluentform_forms';
253 + $forms = $wpdb->get_results( "SELECT id, title FROM {$fluent_form_table} WHERE status = 'published' ORDER BY title ASC" );
254 + if ( ! empty( $forms ) && is_array( $forms ) ) {
255 + foreach ( $forms as $form ) {
256 + $fluent_forms[] = [
257 + 'id' => (string) $form->id,
258 + 'title' => $form->title,
259 + ];
260 + }
261 + }
262 + }
263 +
264 + $is_embed_addon_active = apply_filters( 'is_wpvr_embed_addon_premium', false );
265 + if ( $is_embed_addon_active ) {
266 + if ( wp_script_is( 'custom-qrcode', 'registered' ) ) {
267 + wp_enqueue_script( 'custom-qrcode' );
268 + } elseif ( defined( 'WPVR_PRO_PLUGIN_DIR_URL' ) ) {
269 + wp_enqueue_script( 'custom-qrcode', trailingslashit( WPVR_PRO_PLUGIN_DIR_URL ) . 'admin/lib/qr-code/custom-qrcode.js', [ 'jquery' ], null, true );
270 + }
271 + }
272 +
220 273 wp_localize_script( 'wpvr-tour-editor', 'wpvrTourEditor', [
221 274 'tourId' => $tour_id_cfg ?: null,
222 275 'tourStatus' => $tour_status,
276 + 'tourTitle' => $tour_id_cfg ? get_the_title( $tour_id_cfg ) : '',
277 + 'homeUrl' => home_url( '/' ),
278 + 'isEmbedAddonActive' => $is_embed_addon_active,
223 279 'nonce' => wp_create_nonce( 'wp_rest' ),
224 280 'apiBase' => rest_url( 'wpvr/v1' ),
225 281 'mediaUrl' => rest_url( 'wp/v2/media' ),
226 282 'isPro' => wpvr_is_pro_active(),
@@ -229,8 +285,12 @@
229 285 'postEditUrl' => admin_url( 'post.php' ),
230 286 'faIcons' => $fa_icons,
231 287 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
232 288 'exportNonce' => wp_create_nonce( 'wpvr_export_tour' ),
289 + 'hotspotTypes' => $hotspot_types,
290 + 'fluentForms' => $fluent_forms,
291 + 'isFluentFormActive' => defined( 'FLUENTFORM' ),
292 + 'isWcActive' => class_exists( 'WooCommerce' ),
233 293 'imageResizeWarning' => [
234 294 'ajaxNonce' => wp_create_nonce( 'wpvr' ),
235 295 'canManageSettings' => current_user_can( 'manage_options' ),
236 296 'settingEnabled' => get_option( 'high_res_image' ) === 'true',
@@ -241,13 +301,17 @@
241 301 'close' => __( 'Close', 'wpvr' ),
242 302 ],
243 303 ] );
244 304
305 + $inter_font_path = $plugin_path . 'legacy/public/css/inter.css';
306 + $inter_font_ver = file_exists( $inter_font_path ) ? filemtime( $inter_font_path ) : WPVR_VERSION;
307 + wp_enqueue_style( 'wpvr-inter-font', $public_base . 'css/inter.css', [], $inter_font_ver, 'all' );
308 +
245 309 if ( file_exists( $css_file ) ) {
246 310 wp_enqueue_style(
247 311 'wpvr-tour-editor',
248 312 $plugin_url . 'build/tour-editor/style-index.css',
249 - [ 'wpvr-pannellum-css' ],
313 + [ 'wpvr-pannellum-css', 'wpvr-inter-font' ],
250 314 $asset['version']
251 315 );
252 316 }
253 317 }
@@ -480,13 +544,19 @@
480 544 $style_dependencies[] = 'wpvr-create-tour-modal';
481 545 $script_dependencies[] = 'wpvr-create-tour-modal';
482 546 }
483 547
548 + $tour_listing_css = plugin_dir_path( WPVR_FILE ) . 'app/admin/tour-listing.css';
549 + $tour_listing_css_ver = file_exists( $tour_listing_css ) ? (string) filemtime( $tour_listing_css ) : WPVR_VERSION;
550 +
551 + $tour_listing_js = plugin_dir_path( WPVR_FILE ) . 'app/admin/tour-listing.js';
552 + $tour_listing_js_ver = file_exists( $tour_listing_js ) ? (string) filemtime( $tour_listing_js ) : WPVR_VERSION;
553 +
484 554 wp_enqueue_style(
485 555 'wpvr-tour-listing',
486 556 $plugin_url . 'app/admin/tour-listing.css',
487 557 $style_dependencies,
488 - WPVR_VERSION
558 + $tour_listing_css_ver
489 559 );
490 560
491 561 wp_enqueue_script(
492 562 'wpvr-tour-listing',
@@ -491,9 +561,9 @@
491 561 wp_enqueue_script(
492 562 'wpvr-tour-listing',
493 563 $plugin_url . 'app/admin/tour-listing.js',
494 564 $script_dependencies,
495 - WPVR_VERSION,
565 + $tour_listing_js_ver,
496 566 true
497 567 );
498 568 }
499 569