From a96eaa6937573aa25345c1211ba3e015ff4393f5 Mon Sep 17 00:00:00 2001 From: Dave Ryan Date: Thu, 21 Nov 2024 21:58:17 -0700 Subject: [PATCH] Update logic check to use manage_options --- includes/Config.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Config.php b/includes/Config.php index 672b001..f912811 100644 --- a/includes/Config.php +++ b/includes/Config.php @@ -36,12 +36,12 @@ 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_user_logged_in() ) { - return false; + // Allow fetch if in admin area or if authenticated user can manage options + if ( is_admin() || current_user_can( 'manage_options' ) ) { + $site_capabilities = new SiteCapabilities(); + return $site_capabilities->get( $capability ); } - $site_capabilities = new SiteCapabilities(); - return $site_capabilities->get( $capability ); + return false; } /**