Beeswax
No products were found matching your selection.
// Add column header function add_password_change_column($columns) { $columns['password_last_changed'] = __('Last Password Change', 'text-domain'); return $columns; } add_filter('manage_users_columns', 'add_password_change_column'); // Display content for the new column function display_password_change_column_content($value, $column_name, $user_id) { if ($column_name === 'password_last_changed') { $user = get_userdata($user_id); $last_password_change = $user->user_pass_changed; // If no information about last password change, show empty if (!$last_password_change) { return ''; } $last_password_change_timestamp = strtotime($last_password_change); $days_since_change = floor((time() - $last_password_change_timestamp) / (60 * 60 * 24)); return $days_since_change . ' days ago'; } return $value; } add_action('manage_users_custom_column', 'display_password_change_column_content', 10, 3);
No products were found matching your selection.
No account yet?
Create an Account