From e186f1cfc53ead1d771c5c2f6077709394da516f Mon Sep 17 00:00:00 2001 From: Allen Benny <48691514+officiallygod@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:08:47 +0530 Subject: [PATCH] Update Config.php --- includes/Config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Config.php b/includes/Config.php index 15570c5..554dade 100644 --- a/includes/Config.php +++ b/includes/Config.php @@ -36,6 +36,10 @@ public static function get_wp_config_initialization_constants() { * @return boolean */ public static function get_site_capability( $capability ) { + // Only fetch capabilities in the admin when a user is logged in + if ( ! is_admin() || ! is_user_logged_in() ) { + return false; + } $site_capabilities = new SiteCapabilities(); return $site_capabilities->get( $capability ); }