Skip to content

Commit

Permalink
fixed text domain warning
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Nov 28, 2024
1 parent 33f5639 commit c4ffe8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cryptopay-withdrawal-for-dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'), '<a href="https://wordpress.org/plugins/dokan-lite/" target="_blank">' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . '</a>');
$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'), '<a href="' . admin_url('plugin-install.php?s=Dokan&tab=search&type=term') . '">' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . '</a>');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), wp_kses_post($message));
});
return;
Expand Down

0 comments on commit c4ffe8f

Please sign in to comment.