Skip to content

Commit

Permalink
Merge pull request #81 from newfold-labs/fix/namespacing
Browse files Browse the repository at this point in the history
Add `is_callable` checks
  • Loading branch information
arunshenoy99 authored May 3, 2024
2 parents bd59a93 + 66ec29e commit af38c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function load_php_textdomain() {
}

// Instantiate the internationalization class for only Admins.
if ( is_callable( 'is_admin' ) ) {
if ( is_callable( 'is_admin' ) && is_callable( 'is_user_logged_in' ) && is_callable( 'current_user_can' ) ) {
if ( is_admin() || ( is_user_logged_in() && current_user_can( 'manage_options' ) ) ) {
new I18n();
}
Expand Down

0 comments on commit af38c14

Please sign in to comment.