| 1 |
<?php |
| 2 |
|
| 3 |
namespace RexTheme\WPVR; |
| 4 |
|
| 5 |
class Bootstrap { |
| 6 |
|
| 7 |
public static function init() { |
| 8 |
self::boot(); |
| 9 |
} |
| 10 |
|
| 11 |
public static function activate() { |
| 12 |
if ( function_exists( 'activate_wpvr' ) ) { |
| 13 |
activate_wpvr(); |
| 14 |
} else { |
| 15 |
require_once WPVR_PLUGIN_LEGACY_DIR_PATH . 'includes/class-wpvr-activator.php'; |
| 16 |
\Wpvr_Activator::activate(); |
| 17 |
do_action( 'wpvr_plugin_activated' ); |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
public static function deactivate() { |
| 22 |
if ( function_exists( 'deactivate_wpvr' ) ) { |
| 23 |
deactivate_wpvr(); |
| 24 |
} else { |
| 25 |
require_once WPVR_PLUGIN_LEGACY_DIR_PATH . 'includes/class-wpvr-deactivator.php'; |
| 26 |
\Wpvr_Deactivator::deactivate(); |
| 27 |
do_action( 'wpvr_plugin_deactivated' ); |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
public static function boot() { |
| 32 |
// Full legacy stack — zero breaking changes guarantee. |
| 33 |
require_once WPVR_PLUGIN_LEGACY_DIR_PATH . 'wpvr.php'; |
| 34 |
|
| 35 |
// Override shortcode handler to support new-UI tour formats (street-view saved without streetviewdata). |
| 36 |
new Frontend\Shortcode(); |
| 37 |
|
| 38 |
// New tour editor admin UI. |
| 39 |
new Admin\Admin(); |
| 40 |
|
| 41 |
// REST API routes. |
| 42 |
add_action( 'rest_api_init', [ new Api\Router(), 'register' ] ); |
| 43 |
} |
| 44 |
} |
| 45 |
|