Add Custom Admin Menu Item
Add a new top-level menu item to the WordPress admin dashboard. <?php function add_custom_admin_menu() {…
Add Custom User Meta Field
Add Custom User Meta Field. <?php function add_custom_user_meta_field($user) { ?> <h3>Custom Meta Field</h3> <table class="form-table">…
Show User Profile Picture in Admin
Display user profile picture in the admin user list. <?php function add_profile_picture_column($columns) { $columns['profile_picture'] =…
Add User Registration Date to User Profile
Add the registration date to user profiles. <?php function add_registration_date($user) { $register_date = get_the_author_meta('user_registered', $user->ID);…
Disable File Editor
Disable the theme and plugin editor. <?php define('DISALLOW_FILE_EDIT', true);
Redirect After Logout
Redirect users to a custom URL after logout. <?php function custom_logout_redirect() { wp_redirect(home_url('/goodbye')); // Change…
Auto Login on Registration
Automatically log in users after they register. <?php function auto_login_after_registration($user_id) { wp_set_auth_cookie($user_id); wp_redirect(home_url()); exit; }…
Hide Admin Bar for Specific User Roles
Hide the admin bar for specific user roles. <?php function hide_admin_bar_for_roles() { if (current_user_can('editor') ||…
Send a Custom Welcome Email After Registration
Send a custom welcome email to new users after they register. <?php function custom_welcome_email($user_id) {…