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 -15 9.1.2 → 9.2.0 View file →
@@ -216,8 +216,52 @@
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 +
220 264 $is_embed_addon_active = apply_filters( 'is_wpvr_embed_addon_premium', false );
221 265 if ( $is_embed_addon_active ) {
222 266 if ( wp_script_is( 'custom-qrcode', 'registered' ) ) {
223 267 wp_enqueue_script( 'custom-qrcode' );
@@ -226,23 +270,27 @@
226 270 }
227 271 }
228 272
229 273 wp_localize_script( 'wpvr-tour-editor', 'wpvrTourEditor', [
230 - 'tourId' => $tour_id_cfg ?: null,
231 - 'tourStatus' => $tour_status,
274 + 'tourId' => $tour_id_cfg ?: null,
275 + 'tourStatus' => $tour_status,
232 276 'tourTitle' => $tour_id_cfg ? get_the_title( $tour_id_cfg ) : '',
233 277 'homeUrl' => home_url( '/' ),
234 278 'isEmbedAddonActive' => $is_embed_addon_active,
235 - 'nonce' => wp_create_nonce( 'wp_rest' ),
236 - 'apiBase' => rest_url( 'wpvr/v1' ),
237 - 'mediaUrl' => rest_url( 'wp/v2/media' ),
238 - 'isPro' => wpvr_is_pro_active(),
239 - 'pluginUrl' => $plugin_url,
240 - 'listUrl' => admin_url( 'edit.php?post_type=' . self::POST_TYPE ),
241 - 'postEditUrl' => admin_url( 'post.php' ),
242 - 'faIcons' => $fa_icons,
243 - 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
244 - 'exportNonce' => wp_create_nonce( 'wpvr_export_tour' ),
279 + 'nonce' => wp_create_nonce( 'wp_rest' ),
280 + 'apiBase' => rest_url( 'wpvr/v1' ),
281 + 'mediaUrl' => rest_url( 'wp/v2/media' ),
282 + 'isPro' => wpvr_is_pro_active(),
283 + 'pluginUrl' => $plugin_url,
284 + 'listUrl' => admin_url( 'edit.php?post_type=' . self::POST_TYPE ),
285 + 'postEditUrl' => admin_url( 'post.php' ),
286 + 'faIcons' => $fa_icons,
287 + 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
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' ),
245 293 'imageResizeWarning' => [
246 294 'ajaxNonce' => wp_create_nonce( 'wpvr' ),
247 295 'canManageSettings' => current_user_can( 'manage_options' ),
248 296 'settingEnabled' => get_option( 'high_res_image' ) === 'true',
@@ -253,13 +301,17 @@
253 301 'close' => __( 'Close', 'wpvr' ),
254 302 ],
255 303 ] );
256 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 +
257 309 if ( file_exists( $css_file ) ) {
258 310 wp_enqueue_style(
259 311 'wpvr-tour-editor',
260 312 $plugin_url . 'build/tour-editor/style-index.css',
261 - [ 'wpvr-pannellum-css' ],
313 + [ 'wpvr-pannellum-css', 'wpvr-inter-font' ],
262 314 $asset['version']
263 315 );
264 316 }
265 317 }
@@ -492,13 +544,19 @@
492 544 $style_dependencies[] = 'wpvr-create-tour-modal';
493 545 $script_dependencies[] = 'wpvr-create-tour-modal';
494 546 }
495 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 +
496 554 wp_enqueue_style(
497 555 'wpvr-tour-listing',
498 556 $plugin_url . 'app/admin/tour-listing.css',
499 557 $style_dependencies,
500 - WPVR_VERSION
558 + $tour_listing_css_ver
501 559 );
502 560
503 561 wp_enqueue_script(
504 562 'wpvr-tour-listing',
@@ -503,9 +561,9 @@
503 561 wp_enqueue_script(
504 562 'wpvr-tour-listing',
505 563 $plugin_url . 'app/admin/tour-listing.js',
506 564 $script_dependencies,
507 - WPVR_VERSION,
565 + $tour_listing_js_ver,
508 566 true
509 567 );
510 568 }
511 569