← All changes
|
vendor/team-updraft/lib-central/central/wp-optimize.php
+11
-5
3.7.0
→
4.7.0
View file →
| @@ -36,13 +36,9 @@ | ||
| 36 | 36 | * Class constructor |
| 37 | 37 | */ |
| 38 | 38 | public function __construct() { |
| 39 | 39 | parent::__construct(); |
| 40 | - | |
| 41 | - // Load wp-optimize translations | |
| 42 | - if (defined('UPDRAFTCENTRAL_CLIENT_DIR') && file_exists(UPDRAFTCENTRAL_CLIENT_DIR.'/translations-central.php')) { | |
| 43 | - $this->translations = include_once(UPDRAFTCENTRAL_CLIENT_DIR.'/translations-central.php'); | |
| 44 | - } | |
| 40 | + add_action('updraftplus_load_translations_for_udcentral', array($this, 'load_updraftplus_translations')); | |
| 45 | 41 | } |
| 46 | 42 | |
| 47 | 43 | /** |
| 48 | 44 | * Whether the current user can perform key control AJAX actions |
| @@ -132,8 +128,18 @@ | ||
| 132 | 128 | if ($wp_optimize) { |
| 133 | 129 | if (is_callable(array($wp_optimize, 'log'))) { |
| 134 | 130 | call_user_func(array($wp_optimize, 'log'), $line); |
| 135 | 131 | } |
| 132 | + } | |
| 133 | + } | |
| 134 | + | |
| 135 | + /** | |
| 136 | + * Load translations which are based on UpdraftPlus domain text | |
| 137 | + */ | |
| 138 | + public function load_updraftplus_translations() { | |
| 139 | + // Load wp-optimize translations | |
| 140 | + if (defined('UPDRAFTCENTRAL_CLIENT_DIR') && file_exists(UPDRAFTCENTRAL_CLIENT_DIR.'/translations-central.php')) { | |
| 141 | + $this->translations = include(UPDRAFTCENTRAL_CLIENT_DIR.'/translations-central.php'); | |
| 136 | 142 | } |
| 137 | 143 | } |
| 138 | 144 | |
| 139 | 145 | /** |