Last active
April 1, 2024 06:40
-
-
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
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
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