Convert 'in_stock' Relation to AND in WordPress Query
"To convert the 'in_stock' relation to AND, you need to modify the corresponding meta_query array. Replace the existing 'in_stock' meta_query code with the following code:\n\nphp\n\$meta_query[] = array(\n 'key' => 'qqp_qty',\n 'value' => array('0'),\n 'compare' => '>',\n 'relation' => 'AND' // Add the 'relation' parameter with the value 'AND'\n);\n\$keys[] = 'in_stock';\n\n\nThis will ensure that the 'in_stock' condition is treated as an AND relation with other conditions in the meta_query.\n
原文地址: https://www.cveoy.top/t/topic/qefF 著作权归作者所有。请勿转载和采集!