summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-04 17:01:51 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-04 17:01:51 +0200
commitf6d0f86a9e2a0ab3af398a6fe67d09c3e7779881 (patch)
treeb9b9dd9fb7e233834e212865f10f9a4a1b06714e
parenta04911d243647f5c3a21e22edd5cec8e9ff29cc9 (diff)
downloadgigologadmin-f6d0f86a9e2a0ab3af398a6fe67d09c3e7779881.tar.gz
gigologadmin-f6d0f86a9e2a0ab3af398a6fe67d09c3e7779881.tar.bz2
gigologadmin-f6d0f86a9e2a0ab3af398a6fe67d09c3e7779881.zip
Minor tweak: Only load plugin if in admin side.
-rw-r--r--giglogadmin.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/giglogadmin.php b/giglogadmin.php
index 3751a97..c07941f 100644
--- a/giglogadmin.php
+++ b/giglogadmin.php
@@ -25,14 +25,6 @@
if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
- require_once __DIR__ . '/includes/admin/register_db_tables.php';
- require_once __DIR__ . '/includes/admin/views/giglog_admin_page.php';
- require_once __DIR__ . '/includes/admin/views/giglog_import_gigs.php';
- require_once __DIR__ . '/includes/admin/helpfiles/instrunctions.php';
- require_once __DIR__ . '/includes/admin/helpfiles/instr_reviewers.php';
- require_once __DIR__ . '/includes/admin/helpfiles/instr_photog.php';
- require_once __DIR__ . '/includes/view-helpers/select_field.php';
-
class GiglogAdmin_Plugin
{
static public function init(): void {
@@ -132,6 +124,16 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
register_activation_hook( __FILE__, array( 'GiglogAdmin_Plugin', 'activate' ));
register_deactivation_hook( __FILE__, array( 'GiglogAdmin_Plugin', 'deactivate' ));
- GiglogAdmin_Plugin::init();
+ if (is_admin()) {
+ require_once __DIR__ . '/includes/admin/register_db_tables.php';
+ require_once __DIR__ . '/includes/admin/views/giglog_admin_page.php';
+ require_once __DIR__ . '/includes/admin/views/giglog_import_gigs.php';
+ require_once __DIR__ . '/includes/admin/helpfiles/instrunctions.php';
+ require_once __DIR__ . '/includes/admin/helpfiles/instr_reviewers.php';
+ require_once __DIR__ . '/includes/admin/helpfiles/instr_photog.php';
+ require_once __DIR__ . '/includes/view-helpers/select_field.php';
+
+ GiglogAdmin_Plugin::init();
+ }
}
?>