/** * Returns single instance of the class * * @since 1.0.0 */ public static function get_instance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * On plugin init check query vars for commands to import default tax rates */ function check_import_actions() { if (!isset($_GET["install-tax-rates"])) { return; } if ("standard" == $_GET["install-tax-rates"]) { // import standard tax rates YITH_Tax_Rates::get_instance()->install_standard_rates(); } elseif ("reduced" == $_GET["install-tax-rates"]) { // import reduced tax rates } wp_redirect(esc_url_raw(remove_query_arg("install-tax-rates"))); }