mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 08:52:46 +08:00
* update: convert imports to named imports * add: function to check if current screen is settings page * update: rename elementor logo to app logo * add: url mismatch flow and components * update: remove obsolete code * Update modules/connect/rest/authorize.php Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com> * Update modules/settings/module.php Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com> * fix: modal was not closing * update: remove url mismatch notice * update: mismatch modal and rendering logic * add: toast notifications for errors * update: convert components into styled components * update: remove bottom border from the dialog * update: text copy * fix: logo alignment * update: renamed styled component --------- Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com>
26 lines
628 B
PHP
26 lines
628 B
PHP
<?php
|
|
namespace EA11y\Classes;
|
|
|
|
use EA11y\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_settings_page(): bool {
|
|
$current_screen = get_current_screen();
|
|
return str_contains( $current_screen->id, 'toplevel_page_accessibility-settings' );
|
|
}
|
|
|
|
public static function is_elementor_installed() :bool {
|
|
$file_path = 'elementor/elementor.php';
|
|
$installed_plugins = get_plugins();
|
|
return isset( $installed_plugins[ $file_path ] );
|
|
}
|
|
}
|