| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * Plugin URI: https://wpmet.com/plugin/emailkit/ |
| 6 | 6 | * Description: EmailKit is the most-complete drag-and-drop Email template builder. |
| 7 | 7 | * Author: wpmet |
| 8 | 8 | * Author URI: https://wpmet.com |
| 9 | - * Version: 1.6.7 | |
| 9 | + * Version: 1.6.9 | |
| 10 | 10 | * Text Domain: emailkit |
| 11 | 11 | * License: GPLv3 |
| 12 | 12 | * License URI: https://www.gnu.org/licenses/gpl-3.0.txt |
| 13 | 13 | */ |
| @@ -39,8 +39,10 @@ | ||
| 39 | 39 | register_activation_hook(__FILE__, [$this, 'activate']); |
| 40 | 40 | register_deactivation_hook(__FILE__, [$this,'deactivate_emailkit']); |
| 41 | 41 | |
| 42 | 42 | add_action('plugins_loaded', [$this, 'init_plugin'], 112); |
| 43 | + add_action('init', [$this, 'load_textdomain'], 0); | |
| 44 | + add_action('init', [$this, 'init_promotional'], 10); | |
| 43 | 45 | add_action( 'admin_enqueue_scripts',[$this, 'emailkit_global_assets'] ); |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | /** |
| @@ -67,9 +69,9 @@ | ||
| 67 | 69 | * @return void |
| 68 | 70 | */ |
| 69 | 71 | public function define_constants() |
| 70 | 72 | { |
| 71 | - define('EMAILKIT_VERSION', '1.6.7'); | |
| 73 | + define('EMAILKIT_VERSION', '1.6.9'); | |
| 72 | 74 | define('EMAILKIT_TEXTDOMAIN', 'emailkit'); |
| 73 | 75 | define('EMAILKIT_FILE', __FILE__); |
| 74 | 76 | define('EMAILKIT_PATH', __DIR__); |
| 75 | 77 | define('EMAILKIT_URL', trailingslashit(plugin_dir_url(EMAILKIT_FILE))); |
| @@ -90,11 +92,33 @@ | ||
| 90 | 92 | { |
| 91 | 93 | do_action('emailkit/before_loaded'); |
| 92 | 94 | |
| 93 | 95 | new EmailKit\Admin(); |
| 94 | - (new EmailKit\Promotional\Promotional())->init(); | |
| 95 | 96 | |
| 96 | 97 | do_action('emailkit/after_loaded'); |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * Load the plugin translations | |
| 102 | + * | |
| 103 | + * @return void | |
| 104 | + */ | |
| 105 | + public function load_textdomain() | |
| 106 | + { | |
| 107 | + load_plugin_textdomain('emailkit', false, dirname(plugin_basename(EMAILKIT_FILE)) . '/languages'); | |
| 108 | + } | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * Initialize the promotional classes | |
| 112 | + * | |
| 113 | + * Runs on `init` because these classes translate strings while booting, | |
| 114 | + * and translations must not be loaded before `init`. | |
| 115 | + * | |
| 116 | + * @return void | |
| 117 | + */ | |
| 118 | + public function init_promotional() | |
| 119 | + { | |
| 120 | + (new EmailKit\Promotional\Promotional())->init(); | |
| 97 | 121 | } |
| 98 | 122 | |
| 99 | 123 | public function emailkit_global_assets() |
| 100 | 124 | { |