![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /var/www/theprintave/wp-content/plugins/site-mailer/classes/ |
<?php namespace SiteMailer\Classes; use SiteMailer\Classes\Services\Client; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Utils { public static function get_api_client(): ?Client { return Client::get_instance(); } public static function is_plugin_page(): bool { $current_screen = get_current_screen(); return str_contains( $current_screen->id, 'site-mailer-' ); } public static function user_is_admin(): bool { return current_user_can( 'manage_options' ); } public static function is_wp_dashboard_page(): bool { $current_screen = get_current_screen(); return str_contains( $current_screen->id, 'dashboard' ); } public static function is_wp_settings_page(): bool { $current_screen = get_current_screen(); return str_contains( $current_screen->id, 'options-' ); } }