In order to avoid breaking other plugins that use the manage_users_custom_column filter I think you should add return $val
to sd_modify_user_table_row function so that if the column_name doesn’t match ‘registered’ the unchanged value is returned.
function sd_modify_user_table_row( $val, $column_name, $user_id ) {
$user = get_userdata( $user_id );
if ( $column_name === 'registered' ) {
$t_time = get_the_time( __( 'Y/m/d g:i:s a' ) );
$m_time = $user->user_registered;
$time = mysql2date( 'G', $m_time, false );
$time_diff = time() - $time;
// Get the last 7 days.
$days = ( intval( $time_diff ) / DAY_IN_SECONDS ) % 8;
$days = $days * -1; // Convert negative value to positive.
if ( $days > 0 && $days < 8 ) {
/* translators: Number of days */
$h_time = sprintf( __( '%s days ago', 'users-by-date-registered' ), $days );
}
else {
$h_time = mysql2date( get_option( 'date_format' ), $m_time );
}
return '<abbr title="' . $t_time . '">' . apply_filters( 'user_registered_date_column_time', $h_time, $user ) . '</abbr>';
}
return $val;
} // END sd_modify_user_table_row()
]]>
Installing “Users by Date Registered” blanks out the custom User fields added by the S2Member plugin in the Admin > Users screen. Uninstalling “Users by Date Registered” fixes the issue.
]]>Hello,
After the latest update, there is a bug when searching users in the admin dashboard. The plugin seems to be adding some parameters to the URL.
In the following, I searched for “tester” and this is how the url looked:
users.php?orderby=registered&order=desc&s=tester&action=-1&new_role&userregistered%5B0%5D=0&userregistered%5B1%5D=0&paged=1&action2=-1&new_role2
The code in line 156-192 of “user-by-date-registered.php” caused a server 500 error on my site when I switched to PHP 7. The numbers “01”, “02”, “03”, and so on, in the switch should be surrounded by quotations marks in order to fix this.
]]>Good plugin, but if I install it, the column witn user roles disappears,
can you help me please?
https://www.ads-software.com/plugins/users-by-date-registered/
]]>Hello, just installed the plugin and I’m seeing 1999/11/30 12 a.m. for every user except myself (admin) which appears to be the correct date/timestamp.
Other plugins installed: Google Analytics, Varnish HTTP Purge, and a custom built one for my site that allows me to manually add new users. Out of over 100 users, I’ve only added about 5.
Thoughts? Would really love to have this working!
– Gaby
https://www.ads-software.com/plugins/users-by-date-registered/
]]>