简体   繁体   English

如何在WordPress管理页面的用户列表中添加自定义where条件?

[英]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.

相关问题 在 WordPress 的 Users Admin 页面添加 Custom User-Meta - Add Custom User-Meta to the Users Admin page in WordPress WordPress如何创建自定义分类列表页面? - wordpress how to create custom taxonmy listing page? 如何将自定义 javascript 添加到 WordPress 管理员? - How to add custom javascript to WordPress Admin? 如何将自定义文件添加到自定义文章列表页面 - How add custom fileld to custom article listing page 将自定义 WooCommerce 注册字段添加到管理 WordPress 用户联系人字段 - Add custom WooCommerce registration fields to admin WordPress user contact fields 如何在wordpress中基于登录用户添加条件? - How to add condition based on logged in user in wordpress? 如何在Socialengine 4中为自定义窗口小部件添加管理页面 - How to add an admin page for a custom widget in Socialengine 4 如何在WordPress管理面板中的WooCommerce产品列表中添加复选框列以使用Ajax更新元值 - How to add checkbox column in WooCommerce product listing in WordPress admin panel to update meta value with ajax 如何在用户表wordpress admin中显示自定义用户? - How to show custom users in the user table wordpress admin? 如何更改自定义 WordPress 管理页面的输入字段的值? - How to change the value of the input field of custom WordPress admin page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM