Skip to content

Instantly share code, notes, and snippets.

@mikaelz
Created June 11, 2017 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikaelz/711d6c708523d26037a5ee5fdf9a55d0 to your computer and use it in GitHub Desktop.
Save mikaelz/711d6c708523d26037a5ee5fdf9a55d0 to your computer and use it in GitHub Desktop.
Change WooCommerce email locale
<?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