WP\\U查询有一个称为Meta Query 您可以根据需要传递任意多个复杂参数:
$query = new WP_Query array(
\'meta_query\' => array(
\'relation\' => \'AND\', // OR is the default relation parameter, if this is excluded
array(
\'key\' => \'meta_key_one\',
\'value\' => \'meta_value_one\',
\'compare\' => \'<=\',
),
array(
\'key\' => \'meta_key_two\',
\'value\' => \'meta_value_two\',
\'compare\' => \'<=\',
),
),
) );
上面说:
SELECT
All Posts
WHERE
Meta Keys Value One is Less Than or Equal to Passed Value One
AND
Meta Keys Value Two is Less Than or Equal to Passed Value Two