WordPress currently only allows you to use custom avatars that are uploaded through Gravatar. WP User Avatar enables you to use any photo uploaded into your Media Library as an avatar. This means you use the same uploader and library as your posts. No extra folders or image editing functions are necessary.
WP User Avatar also lets you:
You can use the [avatar_upload] shortcode to add a standalone uploader to any page. It’s best to use this uploader by itself and without other profile fields.
If you’re building your own profile edit page with other fields, WP User Avatar is automatically added to the show_user_profile and edit_user_profile hooks. If you’d rather have WP User Avatar in its own section, you could add another hook:
do_action('edit_user_avatar', $current_user); Then, to add WP User Avatar to that hook and remove it from the other hooks outside of the administration panel, you would add this code to the functions.php file of your theme:
You can change the HTML wrapper of the WP User Avatar section by using the functions wpua_before_avatar and wpua_after_avatar. By default, the avatar code is structured like this:
<div class="wpua-edit-container"> <h3>Avatar</h3> <input type="hidden" name="wp-user-avatar" id="wp-user-avatar" value="{attachmentID}" /> <p id="wpua-add-button"> <button type="button" class="button" id="wpua-add" name="wpua-add">Edit Image</button> </p> <p id="wpua-preview"> <img src="{imageURL}" alt="" /> Original Size </p> <p id="wpua-thumbnail"> <img src="{imageURL}" alt="" /> Thumbnail </p> <p id="wpua-remove-button"> <button type="button" class="button" id="wpua-remove" name="wpua-remove">Default Avatar</button> </p> <p id="wpua-undo-button"> <button type="button" class="button" id="wpua-undo" name="wpua-undo">Undo</button> </p> </div> To strip out the div container and h3 heading, you would add the following filters to the functions.php file in your theme:
<?php remove_action('wpua_before_avatar', 'wpua_do_before_avatar'); remove_action('wpua_after_avatar', 'wpua_do_after_avatar'); ?> To add your own wrapper, you could create something like this:
<?php function my_before_avatar() { echo '<div id="my-avatar">'; } add_action('wpua_before_avatar', 'my_before_avatar'); function my_after_avatar() { echo '</div>'; } add_action('wpua_after_avatar', 'my_after_avatar'); ?> This would output:
<div id="my-avatar"> <input type="hidden" name="wp-user-avatar" id="wp-user-avatar" value="{attachmentID}" /> <p id="wpua-add-button"> <button type="button" class="button" id="wpua-add" name="wpua-add">Edit Image</button> </p> <p id="wpua-preview"> <img src="{imageURL}" alt="" /> <span class="description">Original Size</span> </p> <p id="wpua-thumbnail"> <img src="{imageURL}" alt="" /> <span class="description">Thumbnail</span> </p> <p id="wpua-remove-button"> <button type="button" class="button" id="wpua-remove" name="wpua-remove">Default Avatar</button> </p> <p id="wpua-undo-button"> <button type="button" class="button" id="wpua-undo" name="wpua-undo">Undo</button> </p> </div> Starting from $0 per month.
Rating
Reviewers
2 reviews
Tags
Developed By
Saad Iqbal
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Showcase photos with an image gallery that displays pictures and captions in grids, improves design, and boosts visitor engagement.
Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.
Show AliExpress reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.
Show RSS feed updates with an RSS feed slider that auto updates, displays posts in a smooth layout, and keeps visitors engaged.
Use feature voting so users submit ideas, vote on requests, and help you prioritize product updates by real customer demand.
Create interactive March Madness brackets where users can make predictions, track tournament progress, and compete with others throughout every round.
Use a live weather forecast widget to show current conditions and upcoming predictions, giving visitors real time local weather updates for better planning.
Showcase images with an image carousel that rotates or slides visuals, improves design, and draws attention to key content.
Show your latest TikTok videos in a live feed that keeps content fresh, builds social proof, and keeps visitors engaged.
Use a contact form so visitors can send messages, submit inquiries, and help you collect leads and improve user experience.
Capture email leads with an email subscription form that collects addresses, saves entries, sends notifications, and helps grow your audience.
Encourage interaction with social votes that let visitors like, upvote, and rank content, boosting engagement and guiding better decisions.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
