| @@ -216,21 +216,33 @@ | ||
| 216 | 216 | if ( class_exists( 'Wpvr_fontawesome_icons' ) ) { |
| 217 | 217 | $fa_icons = ( new \Wpvr_fontawesome_icons() )->icon; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | + $is_embed_addon_active = apply_filters( 'is_wpvr_embed_addon_premium', false ); | |
| 221 | + if ( $is_embed_addon_active ) { | |
| 222 | + if ( wp_script_is( 'custom-qrcode', 'registered' ) ) { | |
| 223 | + wp_enqueue_script( 'custom-qrcode' ); | |
| 224 | + } elseif ( defined( 'WPVR_PRO_PLUGIN_DIR_URL' ) ) { | |
| 225 | + wp_enqueue_script( 'custom-qrcode', trailingslashit( WPVR_PRO_PLUGIN_DIR_URL ) . 'admin/lib/qr-code/custom-qrcode.js', [ 'jquery' ], null, true ); | |
| 226 | + } | |
| 227 | + } | |
| 228 | + | |
| 220 | 229 | wp_localize_script( 'wpvr-tour-editor', 'wpvrTourEditor', [ |
| 221 | - 'tourId' => $tour_id_cfg ?: null, | |
| 222 | - 'tourStatus' => $tour_status, | |
| 223 | - 'nonce' => wp_create_nonce( 'wp_rest' ), | |
| 224 | - 'apiBase' => rest_url( 'wpvr/v1' ), | |
| 225 | - 'mediaUrl' => rest_url( 'wp/v2/media' ), | |
| 226 | - 'isPro' => wpvr_is_pro_active(), | |
| 227 | - 'pluginUrl' => $plugin_url, | |
| 228 | - 'listUrl' => admin_url( 'edit.php?post_type=' . self::POST_TYPE ), | |
| 229 | - 'postEditUrl' => admin_url( 'post.php' ), | |
| 230 | - 'faIcons' => $fa_icons, | |
| 231 | - 'ajaxUrl' => admin_url( 'admin-ajax.php' ), | |
| 232 | - 'exportNonce' => wp_create_nonce( 'wpvr_export_tour' ), | |
| 230 | + 'tourId' => $tour_id_cfg ?: null, | |
| 231 | + 'tourStatus' => $tour_status, | |
| 232 | + 'tourTitle' => $tour_id_cfg ? get_the_title( $tour_id_cfg ) : '', | |
| 233 | + 'homeUrl' => home_url( '/' ), | |
| 234 | + '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' ), | |
| 233 | 245 | 'imageResizeWarning' => [ |
| 234 | 246 | 'ajaxNonce' => wp_create_nonce( 'wpvr' ), |
| 235 | 247 | 'canManageSettings' => current_user_can( 'manage_options' ), |
| 236 | 248 | 'settingEnabled' => get_option( 'high_res_image' ) === 'true', |