📜  使用 meta_query 过滤 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:09.377000             🧑  作者: Mango

代码示例1
$args = array(
  'post_type' => 'product',
  'product_cat' => $food_category->slug,
  'meta_query' => array(
     array(
        'key'     => '_location',
        'value'   => '%"newyork"%', // note the quotes
        'compare' => 'LIKE',
     ),
   ),
 );