您正在设置两个不同的meta\\u键字段以检查:\'course\'
, 和\'clinic\'
. 试着用这样的一个来做:
$args = array(
\'orderby\' => \'display_name\',
\'fields\' => \'all\',
\'search\' => $search,
\'meta_query\' => array(
array(
\'key\' => \'clinic\',
\'value\' => $search,
\'compare\' => \'LIKE\'
)
)
);
当前查询所做的是返回与
$search
基本用户列和元键“clinic”上的参数。这是你的意图吗?
Update 3/24/16:
尝试以下操作:
$args = array(
\'orderby\' => \'display_name\',
\'fields\' => \'all\',
\'search\' => $search,
\'meta_query\' => array(
\'relation\' => \'OR\',
array(
\'key\' => \'course\',
\'value\' => $search,
\'compare\' => \'LIKE\'
),
array(
\'key\' => \'clinic\',
\'value\' => $search,
\'compare\' => \'LIKE\'
)
)
);