| @@ -109,9 +109,9 @@ | ||
| 109 | 109 | private function set_locale() { |
| 110 | 110 | |
| 111 | 111 | $plugin_i18n = new MakeCommerce\i18n(); |
| 112 | 112 | |
| 113 | - $this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' ); | |
| 113 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | 117 | * Register all of the hooks related to cron functionality |
| @@ -150,14 +150,8 @@ | ||
| 150 | 150 | //Add admin notice if api is not set up |
| 151 | 151 | if ( !\MakeCommerce::get_api() ) { |
| 152 | 152 | $this->loader->add_action( 'admin_notices', $api, 'api_info_missing' ); |
| 153 | 153 | } |
| 154 | - | |
| 155 | - //Add admin notice about Shipping+ | |
| 156 | - $this->loader->add_action( 'admin_notices', $api, 'shipping_api_notice' ); | |
| 157 | - | |
| 158 | - //if API type is updated then refresh the cache | |
| 159 | - $this->loader->add_action( 'update_option_mk_api_type', $api, 'mk_delete_api_cache' ); | |
| 160 | 154 | |
| 161 | 155 | //add API access menu in woocommerce->settings->advanced (_api version is for WC <= 3.4.0) |
| 162 | 156 | $this->loader->add_action( 'woocommerce_get_sections_advanced', $api, 'add_woo_menu' ); |
| 163 | 157 | $this->loader->add_action( 'woocommerce_get_sections_api', $api, 'add_woo_menu'); |
| @@ -178,15 +172,8 @@ | ||
| 178 | 172 | //adds settings link to plugins page |
| 179 | 173 | $this->loader->add_filter( 'plugin_action_links_makecommerce/makecommerce.php', $api, 'add_plugin_settings_link' ); |
| 180 | 174 | |
| 181 | 175 | $this->loader->add_filter( 'woocommerce_admin_field_api_javascript_ui', $api, 'api_javascript_ui' ); |
| 182 | - | |
| 183 | - // Shipping plus confirmation page in Admin panel and related hooks to it | |
| 184 | - $this->loader->add_action('admin_enqueue_scripts', $api, 'enqueue_shipping_plus_assets'); | |
| 185 | - $this->loader->add_action('admin_menu', $api, 'add_shipping_plus_admin_page'); | |
| 186 | - $this->loader->add_action( 'admin_head', $api, 'remove_shipping_confirm_menu', 15 ); | |
| 187 | - $this->loader->add_action( 'admin_head', $api, 'hide_shipping_admin_notices' ); | |
| 188 | - $this->loader->add_action( 'admin_init', $api, 'save_shipping_plus_confirmation' ); | |
| 189 | 176 | } |
| 190 | 177 | |
| 191 | 178 | /** |
| 192 | 179 | * Register all of the hooks related to the public-facing functionality |
| @@ -217,16 +204,11 @@ | ||
| 217 | 204 | $this->loader->add_filter( 'posts_where', $plugin_shipping, 'shipping_filter', 10, 2 ); |
| 218 | 205 | |
| 219 | 206 | $this->loader->add_filter( 'woocommerce_order_status_processing', $plugin_shipping, 'register_shipment' ); |
| 220 | 207 | |
| 221 | - $this->loader->add_action( 'woocommerce_update_order', $plugin_shipping, 'set_parcel_machine_meta' ); | |
| 222 | - $this->loader->add_action( 'woocommerce_update_order', $plugin_shipping, 'update_courier_meta' ); | |
| 208 | + $this->loader->add_action( 'save_post', $plugin_shipping, 'set_parcel_machine_meta' ); | |
| 209 | + $this->loader->add_action( 'save_post', $plugin_shipping, 'update_courier_meta' ); | |
| 223 | 210 | |
| 224 | - $this->loader->add_action( 'wp_ajax_update_map_center', $plugin_shipping, 'update_map_center' ); | |
| 225 | - $this->loader->add_action( 'wp_ajax_nopriv_update_map_center', $plugin_shipping, 'update_map_center' ); | |
| 226 | - | |
| 227 | - $this->loader->add_action( 'update_option_mc_map_geocoding_api_key', $plugin_shipping, 'mc_check_api_key' ); | |
| 228 | - $this->loader->add_action( 'admin_notices', $plugin_shipping, 'invalid_api_key_notification' ); | |
| 229 | 211 | } |
| 230 | 212 | |
| 231 | 213 | /** |
| 232 | 214 | * Run the loader to execute all of the hooks with WordPress. |