Skip to content

Commit

Permalink
Prevent fetching capabilities on the front-end
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Oct 28, 2024
1 parent 4c95be7 commit 4195971
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 ) {
// Make sure we don't fetch capabilities on the front-end
if ( ! is_admin() ) {
return false;
}
$site_capabilities = new SiteCapabilities();
return $site_capabilities->get( $capability );
}
Expand Down

0 comments on commit 4195971

Please sign in to comment.