Skip to content

Commit

Permalink
Add is_callable checks
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed May 3, 2024
1 parent 981034f commit cf7edb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static function load_php_textdomain() {
}

// Instantiate the internationalization class for only Admins.
if ( is_callable( 'is_admin' ) ) {
if ( \is_admin() || ( \is_user_logged_in() && \current_user_can( 'manage_options' ) ) ) {
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();
}
}

0 comments on commit cf7edb8

Please sign in to comment.