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
/* | |
* Example adds certain named Product Attribute fields to the product Edit screen ready for completion. | |
* (Pre-requisite ) | |
* This saves the Shop Admin having to add them manually. | |
* | |
* Why might you want to do this instead of adding Custom fields? There's plenty of nice documentation on adding custom fields | |
* for example: http://www.remicorson.com/mastering-woocommerce-products-custom-fields/ | |
* | |
* Well a Product Attributes are a built in WooCommerce feature, using Terms which are a built in Wordpress feature. | |
* - no add-ons required |
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
function user_alert($atts = array()){ | |
$a = shortcode_atts( array( | |
'name' => 'saleflash', | |
), $atts ); | |
$translation = pll__($a['name']); | |
$output=''; | |
/* don't output visible message if no translation available */ | |
if ($translation == '' || $translation == $a['name']){ | |
//on non-production environments script debug should be enabled |
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 | |
/* | |
* when switching language for order email, unload these additional text domains | |
*/ | |
function ii_unload_email_textdomains() { | |
unload_textdomain( 'inkston-integration' ); | |
unload_textdomain( 'woo-advanced-shipment-tracking' ); | |
} | |
add_action( 'woo-poly.Emails.switchLanguage', 'ii_unload_email_textdomains' ); | |
/* |