Why get_users() not working on the admin backend?

Perhaps user.php has not yet been loaded. get_users() is a wrapper for WP_User_Query, which is defined in wp-includes/user.php. Hooks indicate template_redirect is after wp, after users are registered. Perhaps you could try conditionally hooking ‘template_redirect’ on the front-end and ‘user_admin_menu’ on the back-end. if (is_admin()){ add_action(‘user_admin_menu’,’manage_new_user_submit’); } else { add_action(‘template_redirect’,’manage_new_user_submit’); } Also, you might remove … Read more

User last login and user last visit problem

When you are using human_time_diff for convert time to human readable format. your last_visit meta empty that is why it is return 50 years. so before convert human_time_diff you have to check value is not empty. use below code to display last_login, last_visit. $users = get_users(); foreach( $users as $user ) { $udata = get_userdata( … Read more

Save User Meta Email Address in Lowercase

you can use this filter to do that add_filter(“sanitize_email”, function ($sanitized_email, $email, $message) { $sanitized_email = strtolower($sanitized_email); return $sanitized_email; }, 10, 3); but I am not sure if using “strtolower” is a good idea, does another readers know if it’s better to use “mb_strtolower” to handle multibyte characters ? https://www.php.net/manual/en/ref.mbstring.php

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)