我已经在wordpress中实现了自定义搜索,但是当你通过user_email搜索时,搜索不会返回结果,只有first_name&姓氏工作。这是我的代码......
$search_string = esc_attr( $search );
$users = new WP_User_Query( array(
'search' => "*{$search_string}*",
'search_columns' => array(
'user_login',
'user_nicename',
'user_email',
'user_url',
),
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'first_name',
'value' => $search_string,
'compare' => 'LIKE'
),
array(
'key' => 'last_name',
'value' => $search_string,
'compare' => 'LIKE'
)
)
) );
$users_found = $users->get_results();
我无法通过电子邮件地址搜索,...即使代码看起来有效,我也没有结果。
答案 0 :(得分:2)
您必须单独为for (z in 1:12)
{
w=1
while ((FORCADA_ALEATORIOS[z]>=BASE_DADOS[w,2] & FORCADA_ALEATORIOS[z]<BASE_DADOS[w,3] &
w<=length(BASE_DADOS)) | (FORCADA_ALEATORIOS[z]>=BASE_DADOS[w,3] &
w<=length(BASE_DADOS)) )
{
ALEATORIOS_FREQUENCIA[z]<-BASE_DADOS[w,1]
w=w+1
}
}
编写查询,如下所示: -
user_email