Skip to content

Commit f3a3c6c

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 4fe57de + 1e3ba55 commit f3a3c6c

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

includes/class-STL_Settings.php

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public function admin_enqueue( $hook ) {
4141
}
4242

4343
public function add_plugin_page(){
44+
if (stl_staging_exists()) {
45+
return;
46+
}
4447
add_menu_page(
4548
__( 'Staging2Live', 'staging2live' ),
4649
__( 'Staging2Live', 'staging2live' ),

includes/class-stl-admin.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ class STL_Admin {
2929
* Constructor
3030
*/
3131
private function __construct() {
32-
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
33-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
32+
if (!stl_staging_exists()) {
33+
return;
34+
}
35+
36+
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
37+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
3438
}
3539

3640
/**

staging2live.php

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ function stl_init(): void {
6767
}
6868
add_action ( 'plugins_loaded', 'stl_init' );
6969

70+
function stl_staging_exists(): bool {
71+
global $wpdb;
72+
return $wpdb->get_var("SHOW TABLES LIKE 'wp_staging_options'") == 'wp_staging_options';
73+
}
74+
7075
// Autoload all PHP files in the includes/ folder.
7176
foreach ( glob( STL_PLUGIN_PATH . 'includes/class-*.php' ) as $filename ) {
7277
include_once $filename;

0 commit comments

Comments
 (0)