PluginProbe
Manage – Centralized site maintenance and monitoring / trunk
Manage – Centralized site maintenance and monitoring vtrunk
1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4
manage / classes / utils.php

utils.php in Manage – Centralized site maintenance and monitoring trunk, at classes/utils.php

27 lines 541 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Manage\Classes;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Utils {
10
11 public static function user_is_admin(): bool {
12 return current_user_can( 'manage_options' );
13 }
14
15 public static function is_wp_dashboard_page(): bool {
16 $current_screen = get_current_screen();
17
18 return str_contains( $current_screen->id, 'dashboard' );
19 }
20
21 public static function is_wp_settings_page(): bool {
22 $current_screen = get_current_screen();
23
24 return str_contains( $current_screen->id, 'options-' );
25 }
26 }
27