Can I provide a user’s user_ID to them and can it also be searchable in a member’s directory

This will give the user id of the currently logged in user: $current_user_id = get_current_user_id(); User IDs are assigned sequentially (normally) when a user is created in WP admin (or by a process that creates the user ID programmatically). But be aware that the user ID can be abused. For instance, one could query your … Read more

Set a minimal number for next user_id

You can access via phpMyAdmin and change the Auto Increment number to be your next user ID number. Open phpMyAdmin Go to SQL tab at the top. Enter the following: ALTER TABLE ‘wp_users’ AUTO_INCREMENT=32200906; Now create a new user and the ID should be 32200906

Send email to user if their role is changed to Author

Check for the value of $new_role before sending the email, if it isn’t author then do nothing function user_role_update( $user_id, $new_role ) { if ( $new_role == ‘author’ ) { $site_url = get_bloginfo( ‘wpurl’ ); $user_info = get_userdata( $user_id ); $to = $user_info->user_email; $subject=”Role changed: ” . $site_url . ”; $message=”Hello ” . $user_info->display_name . … Read more