Use this hook function to replace user’s avatar (which is passed in as HTML <img ...>
tag) if user’s ID or email matches your condition. You can use any other default image, or get individual replacement image for each user.
function my_get_avatar($avatar, $id_or_email, $size, $default, $alt) {
if ($id_or_email == "[email protected]") {
$img = "http://path.to/default/avatar.jpg";
$avatar = "<img src="".$img ."" alt="".$alt."" height="".$size."" width="".$size."" />";
}
return $avatar;
}
add_filter('get_avatar', 'my_get_avatar', 10, 5);
Related Posts:
- Upload gravatar in WP profile?
- Changing default Buddypress avatar affects all site avatars (because gravatar)
- Get users only if Gravatar is specified
- Find out if logged in user is not subscriber
- Get multiple roles with get_users
- How to Merge Two Authors Into One?
- Whats the best way to share user data across multiple WordPress websites?
- User-edit role setting distinct from wp_capabilities? [closed]
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- Hide Admin Menu for Specific User ID who has administrator Role
- Problem with Hebrew characters in username
- Display edit link if post author is current user
- Change user’s display name programmatically
- Do not allow users to create new posts and pages
- Send activation email to user after signup [duplicate]
- wp_update_user() does not update user_data
- Set user after wp_create_user?
- Sort get_users by custom field
- How to add follow functionality to multi-author wordpress site?
- Get user input from a form
- How to add wordpress username after url?
- ACF Upload Image in front-end with custom form
- User fields that can be edited by administrator?
- Admins can’t edit each other’s posts
- Update user_login to change username
- Can I bulk register contributors for a new blog
- show cimy user fields in users.php with manage_users_columns
- Multiple authors with different “author roles”
- Exclude subscriber users from user list
- Can’t add users in admin after copying database
- How can i create an array user meta?
- How can I check if a user’s email exists in the database
- Getting users by specific capability, not role
- Creating user in Firebase after WordPress user registration
- Exclude admin from user list
- How to display total number of post done by user, it should display at authors page wordpress [duplicate]
- Displaying different in-page content to cliente/admin
- Can i add password field into my wp registration form?
- User capability for editing their own comments
- Delete User via Frontend
- how to get WordPress admin user table columns name in my plugin
- Allow Contributors to Upload Files
- Create Next and Previous Link to User orderby Last Name
- OAuth 2 and saving the authenticated user
- Spam users registers even when registration is disabled
- How to notify specific users when i’m posting/modifying a new post
- Limitations when adding new users
- Fetch all data of Users
- Get an array of all users of a custom role type to send an email notification on post update
- Allow users to create post without logging in?
- create new users in db starting at what ID?
- About WordPress capabilities [closed]
- No more administrator roles / permissions after WordPress upgrade
- How to display text if profile fields are not filled?
- Load user by specific role
- Order users by user role
- Get user by meta key – WP multi site
- Force users to use password with specifications
- Change user slug in Buddypress
- Creating a user from a different website
- Give users alternative/second avatar that is rectangle sized
- New User Save Filter
- Inserting current user ID into Post for Author
- Difference between is_user_logged_in and $_session[‘uname’]
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- Using my own user table
- Add number of members to “Right Now” dashboard widget
- How can I add authors in WordPress and assign them a picture?
- wp_generate_password sets password but can’t login using created password
- add class to element if user is not logged in [closed]
- Get users meta and show to attribute
- How can admins to be notified of changes when users change their WP profiles?
- Can you Recover a WordPress User from a Backup
- wp-admin/users.php Add a column with last name
- 502 Error when edit some users
- How do I delete a wordpress user from giant database?
- get_users – Sort by a different meta_value than search criteria
- How to prevent deleteting specific user?
- Display recent members
- Update user counts in admin interface
- How to get the username for a custom link
- To save user info on the same page by form submiting
- Groups roles & capabilities
- Button for users to upgrade their user role + Button to show current user role!
- Restrict Access to the User Profile
- How do I Limit the number of pages a non-subscriber can see?
- Username has been exposed
- How To Find The ID Of All Registered Users?
- How to order posts by the user_login that corresponds to a meta_value (which is a user id)?
- How to get only 1 role from user
- Retrieve New user’s ID
- Restrict access to certain dashboard pages based on user id
- how to show logged in members username in wordpress content
- How to expire guest users after 1.5 hours logged in?
- hide woo commerce dashboard status and reports from woo commerce from specific users but display to other users
- User agent stylesheet distorting site [closed]
- WordPress – Security Question at Login from User’s Meta Data
- Set a minimal number for next user_id
- Remove My Account Menu items in Woocommerce based on user roles