任何问题请联系WX:uu16853

买模板送网站采集器 让你轻松放开双手运营网站!

购买更多有优惠!

WordPress 后台用户列表显示用户注册时间

WordPress后台的用户列表默认是没有显示用户注册时间的,如果你要添加这个功能,将下面的代码添加到当前主题的 functions.php 文件即可。 注:该方法不支持多站点模式,也只能在 WP 3.1 以上版本使用。 2013-09-05更新:修正时间显示相差8小时问题和时间显示样式(12-19行);解决与《WordPress 后台用户列表添加上次登录时间》的冲突(43行)。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 /** […]

WordPress 技巧:按照用户注册时间排序

在 WordPress 后台,用户是按照用户名排序的,并且没有显示注册时间,如果我们希望能够在后台看到用户的注册时间,并且按照注册时间排序,可以通过下面的代码实现: <?php /* Plugin Name: 按照用户注册时间排序 Plugin URI: http://blog.wpjam.com/m/order-by-user-registered-time/ Description: 显示用户注册时间,并按照用户注册时间排序。 Version: 0.1 Author: Denis Author URI: http://blog.wpjam.com/ */ add_filter('manage_users_columns','wpjam_add_users_column_reg_time'); function wpjam_add_users_column_reg_time($column_headers){ $column_headers['reg_time'] = '注册时间'; return $column_headers; } add_filter('manage_users_custom_column', 'wpjam_show_users_column_reg_time',11,3); function wpjam_show_users_column_reg_time($value, $column_name, $user_id){ if($column_name=='reg_time'){ $user = get_userdata($user_id); return get_date_from_gmt($user->user_registered); }else{ return $value; } } add_filter( "manage_users_sortable_columns", 'wpjam_users_sortable_columns' ); function ys_users_sortable_columns($sortable_columns){ $sortable_columns['reg_time'] = […]

100% Secure Checkout

PayPal / MasterCard / Visa