Query Product categories what have a custom field

Im trying to build a page template on wordpress that will show a list a categories that have a custom field checked.

So the taxonomy is just the default woocommerce taxonomy product_cat I then have a custom field to the product_cat taxonomy which is a check box called collectable

My set up is
Main Category

  • Child
  • Child
  • Child
  • Child

So for example 2 children categories have the tick box collectable which is set to add the value of 1 into the datbase

So I am doing a page where it will show all categories with the collectable checked.

$args = array(
    'post-type' => 'product',
    'taxonomy' => 'product_cat',
    'hide_empty' => 0
  );
  $c = get_categories($args);
  $c_keep = array();
  foreach($c as  $cat){
 if (get_field('collectable', 'category_'.$cat->term_id)) {
      $c_keep[] = $cat;
    }  
  }
  
  foreach($c_keep as $cat){
    echo $cat->name;
  }

But I am getting nothing at all returned.

I even put a

print_r( $args );

But I am still coming up with a blank (Header and footer Loads and the text above the query)

Can anyone help please

Go to Source
Author: user1348927

How to remove the search field in custom taxonomy ui?

In recent versions of wordpress I see a new search/autocomplete text field on top the custom taxonomy metabox (when hierarchical). I also see the taxonomy slug with it (“project_type” in the attached image).

How can I remove It? Is there an argument for that when registering the taxonomy?

enter image description here

Go to Source
Author: Marc