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