[英]How to add custom where condition in user listing at WordPress admin page?
In wordpress I have found a posts_where filter to add custom where conditions in listing posts. 在wordpress中,我找到了一个posts_where过滤器,用于在列表中添加自定义where条件。 Like this is there any filter to add custom where condition for listing the users?
像这样有没有任何过滤器来添加自定义条件,以列出用户?
Make a custome query like: 进行如下查询:
$rows = $wpdb->get_row($wpdb->prepare("SELECT post_title FROM wp_posts WHERE ID = $page_id "));
if($rows){
echo "win";
} }
But! 但!
use get_row if you want to display 1 record. 如果要显示1条记录,请使用get_row。
If you display multiple recorsd use 如果显示多次记录使用
$searchvalue = $wpdb->get_results("QUERY");
foreach($searchvalue as $sh)
{
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.