capture_user_registration_details

add_action(‘user_register’, ‘capture_user_registration_details’, 10, 1); function capture_user_registration_details($user_id) { $user_info = get_userdata($user_id); // Capture and store registration details $details = [ ‘First name’ => $user_info->first_name, ‘Last name’ => $user_info->last_name, ‘Email’ => $user_info->user_email, ]; // Store details in a transient, expire after 1…Continue reading

Admin Editable Usernames

// Register the form field and save action only if the Code Snippets plugin is active if (function_exists(‘add_action’)) { // Show the new username field on the user profile page for admins add_action(‘edit_user_profile’, ‘custom_admin_edit_username_field’); // Save the new username if…Continue reading

Add custom users list in menu

add_action(‘admin_menu’, ‘add_custom_users_sorting_link_as_first’); function add_custom_users_sorting_link_as_first() { global $submenu; // Check if current user has the capability to list users if (!current_user_can(‘list_users’)) { return; } // Define the custom submenu item $custom_submenu_item = array( ‘Last Registered User’, // Menu title ‘list_users’, //…Continue reading

hide in profile: Personal Options, Language and Name texts

function hide_elements_in_profile_page() { $screen = get_current_screen(); // Check if the current screen is the profile or user edit screen if ( $screen->id == “profile” || $screen->id == “user-edit” ) { echo ‘ ‘; } } add_action(‘admin_head’, ‘hide_elements_in_profile_page’);Continue reading

Remove WordPress logo

// Remove WordPress logo from the profile page for all users function remove_wp_logo_profile_page() { echo ‘ ‘; } add_action(‘admin_head’, ‘remove_wp_logo_profile_page’);Continue reading

Disable Player Name editing with checkbox

// Add checkbox to user profile for administrators to restrict nickname change function add_nickname_change_restriction_field($user) { if (current_user_can(‘administrator’)) { // Display checkbox only for administrators ?>Continue reading

User columns width

function custom_admin_user_list_column_width() { echo ‘ ‘; } add_action(‘admin_head-users.php’, ‘custom_admin_user_list_column_width’);Continue reading