From f6d0f86a9e2a0ab3af398a6fe67d09c3e7779881 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 4 Sep 2021 17:01:51 +0200 Subject: Minor tweak: Only load plugin if in admin side. --- giglogadmin.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'giglogadmin.php') 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(); + } } ?> -- cgit v1.2.3