Skip to content

Commit

Permalink
Update Config.php
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod authored Nov 21, 2024
1 parent 1378dfc commit e186f1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit e186f1c

Please sign in to comment.