Skip to content

Commit

Permalink
Update logic check to use manage_options
Browse files Browse the repository at this point in the history
  • Loading branch information
0aveRyan committed Nov 22, 2024
1 parent 3ea8ca6 commit a96eaa6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit a96eaa6

Please sign in to comment.