当我们有10多个元密钥时,我就可以百分之百地使用服务器。是否有任何选项可以优化查询。
$meta_query = array(\'relation\' => \'AND\');
foreach ($requestData as $key => $value) {
$meta_query[] = array(
\'key\' => $value,
\'value\' => \'1\',
\'compare\' => \'=\'
);
}
$args = array( \'post_type\' => \'healthcare\', \'post_status\' => \'publish\', \'posts_per_page\' => -1, \'meta_query\' => $meta_query);
$loop = new WP_Query( $args );
$total = $loop->found_posts;