From c4ffe8f65f2642cde908b7b0b6da1d6bdde9af0e Mon Sep 17 00:00:00 2001 From: BeycanDeveloper Date: Thu, 28 Nov 2024 13:24:32 +0300 Subject: [PATCH] fixed text domain warning --- cryptopay-withdrawal-for-dokan.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cryptopay-withdrawal-for-dokan.php b/cryptopay-withdrawal-for-dokan.php index 5da4b6f..762a80b 100644 --- a/cryptopay-withdrawal-for-dokan.php +++ b/cryptopay-withdrawal-for-dokan.php @@ -34,15 +34,18 @@ define('DOKAN_CRYPTOPAY_URL', plugin_dir_url(__FILE__)); define('DOKAN_CRYPTOPAY_PATH', plugin_dir_path(__FILE__)); +add_action('init', function (): void { + load_plugin_textdomain('cryptopay-withdrawal-for-dokan', false, basename(__DIR__) . '/languages'); +}); + add_action('plugins_loaded', function (): void { require_once __DIR__ . '/classes/DokanCryptoPayWithdrawal.php'; - load_plugin_textdomain('cryptopay-withdrawal-for-dokan', false, basename(__DIR__) . '/languages'); if (!function_exists('dokan')) { add_action('admin_notices', function (): void { $class = 'notice notice-error'; // translators: %s: Dokan plugin URL - $message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs Dokan to work. You can buy download Dokan by %s.', 'cryptopay-withdrawal-for-dokan'), '' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . ''); + $message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs Dokan to work. You can buy download Dokan by %s.', 'cryptopay-withdrawal-for-dokan'), '' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . ''); printf('

%2$s

', esc_attr($class), wp_kses_post($message)); }); return;