M
M
Muvka2019-04-19 09:41:51
WordPress
Muvka, 2019-04-19 09:41:51

Why did meta_query stop working in get_terms?

I divide the categories into types, for output in different places. To do this, I created an additional field 'cat_type', where I select the category belonging. Updated yesterday Woocommerce to the current version. Previously, everything was fine, but now all categories are displayed in all places. Everything is fine in the database. What could be the reason? Here are the main category query arguments

array(
  'taxonomy' => 'product_cat',
  'update_term_meta_cache' => true,
  'meta_query' => array(
    array(
      'key'     => 'cat_type',
      'value'   => '1'
    )
  )
)

Who knows what might have changed?
Here is a screenshot from the database 5cb96df1d9825655823137.png
Addition: shortening arguments just to
array(
  'meta_query' => array(
    array(
      'key'     => 'cat_type',
      'value'   => '1'
    )
  )
)

works. Why is that?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question