I have this function:
add_filter( 'prdctfltr_show_filter', 'my_hide_filter_on_category_function_jkbg4iu3b' );
function my_hide_filter_on_category_function_jkbg4iu3b() {
if ( is_product_category( 'cheese' ) ) {
return false;
}
return true;
}
Is any possibility to use ONE function and ONE filter but for MANY WooC Product Categories - not only for "cheese" but also for "sausages, wine, chocolate, etc" at ONE function and ONE filter?
Something like:
or: if ( is_product_category( 'cheese' or "ham" ) ) {
or: if ( is_product_category( 'cheese' || "ham" ) ) {
or: if ( is_product_category( array => 'cheese, ham" ) ) {
?
I have this function:
add_filter( 'prdctfltr_show_filter', 'my_hide_filter_on_category_function_jkbg4iu3b' );
function my_hide_filter_on_category_function_jkbg4iu3b() {
if ( is_product_category( 'cheese' ) ) {
return false;
}
return true;
}
Is any possibility to use ONE function and ONE filter but for MANY WooC Product Categories - not only for "cheese" but also for "sausages, wine, chocolate, etc" at ONE function and ONE filter?
Something like:
or: if ( is_product_category( 'cheese' or "ham" ) ) {
or: if ( is_product_category( 'cheese' || "ham" ) ) {
or: if ( is_product_category( array => 'cheese, ham" ) ) {
?
Share Improve this question edited Jan 17, 2020 at 15:51 TomC 1,3168 silver badges18 bronze badges asked Jan 17, 2020 at 12:38 justdudejustdude 215 bronze badges1 Answer
Reset to default 3Yes, you can use it like:
if ( is_product_category('cheese', 'fruit', 'meat') )
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744825991a4595799.html
评论列表(0条)