Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sarancartrabbit/1acad1932df8e9bc0c24402b5c555829 to your computer and use it in GitHub Desktop.
Save sarancartrabbit/1acad1932df8e9bc0c24402b5c555829 to your computer and use it in GitHub Desktop.
Woo Discount Rules: To load ethosstore taxonomies in rule filter when if is not loads
add_filter('advanced_woo_discount_rules_get_custom_taxonomies', function($custom_taxonomies) {
if (function_exists('get_taxonomies')) {
$custom_taxonomies = array_filter(get_taxonomies(array(
'show_ui' => true,
'show_in_menu' => true,
'object_type' => array('product','ethosstore'),
), 'objects'), function ($tax) {
return !in_array($tax->name, array('product_cat', 'product_tag'));
});
}
return $custom_taxonomies;
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment