Created
June 11, 2017 15:57
-
-
Save mikaelz/711d6c708523d26037a5ee5fdf9a55d0 to your computer and use it in GitHub Desktop.
Change WooCommerce email locale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Slovak WooCommerce emails | |
* Plugin URI: https://www.nevilleweb.sk/ | |
* Description: Send only slovak WooCommerce emails | |
* Version: 1.0.0 | |
* Author: Michal Zuber | |
* Author URI: https://nevilleweb.sk/ | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; // Exit if accessed directly. | |
} | |
add_filter('plugin_locale', 'custom_locale', 10, 2); | |
function custom_locale($locale, $domain) | |
{ | |
if ('woocommerce' == $domain && isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'checkout') { | |
return 'sk_SK'; | |
} | |
return $locale; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment