| 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 |
|