Skip to content

Commit a514a38

Browse files
committed
Add a failsafe to prevent multiple versions of Code Snippets from running simultaniously
1 parent 6f850f2 commit a514a38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

code-snippets.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
return;
3434
}
3535

36+
/* If a version of code snippets has already been loaded, then deactivate this plugin. */
37+
if ( defined( 'CODE_SNIPPETS_FILE' ) ) {
38+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
39+
deactivate_plugins( array( 'code-snippets/code-snippets.php' ), true );
40+
return;
41+
}
42+
3643
/**
3744
* The full path to the main file of this plugin
3845
*

0 commit comments

Comments
 (0)