我需要您在meta\\u查询中提供多个值的帮助。我有一个复选框过滤器。这是我提出的问题:
但是,我担心查询没有得到优化,这会减慢网站的速度。
我阅读了这个问题中提出的解决方案:meta_query with multiple values但是,当我实施该解决方案时,我有以下错误:“Warning: trim() expects parameter 1 to be string“。
有没有办法优化此查询?
我会感激你的帮助。
非常感谢。
$args = array(
\'post_type\' => \'post\' ,
\'meta_key\' => $meta_value,
\'orderby\' => $sort . \' date\',
\'order\' => $order_sort,
\'posts_per_page\' => 10,
\'cat\' => $category,
\'paged\' => $paged,
\'meta_query\' => array(
\'relation\' => \'OR\',
array(
\'key\' => \'checkboxes\',
\'value\' => $face,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'checkboxes\',
\'value\' => $twitter,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'checkboxes\',
\'value\' => $telegram,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'checkboxes\',
\'value\' => $reddit,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'checkboxes\',
\'value\' => $email,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'checkboxes\',
\'value\' => $phone,
\'compare\' => \'LIKE\'
),
)
);