Set a custom profile image (avatar) for a user using the standard WordPress media upload tool.
User Profile Picture is no longer under active development, but will continue to work as is. We have integrated the current functionality in Profile Builder where it will actively be maintained, and we recommend migrating to it.
Set or remove a custom profile image for a user using the standard WordPress media upload tool.
View Documentation and Examples
Users must have the ability to upload images (typically author role or greater). You can use the plugin Profile Builder to allow other roles (e.g. subscribers) the ability to upload images.
A template tag is supplied for outputting to a theme and the option to override a user’s default avatar is also available.
See the documentation on GitHub.
Please Rate the Plugin.
metronet-profile-picture
folder to the /wp-content/plugins/
directory<?php mt_profile_img() ?>
in your templates (arguments and usage are below)Arguments:
/** * mt_profile_img * * Adds a profile image * @param $user_id INT - The user ID for the user to retrieve the image for @ param $args mixed size - string || array (see get_the_post_thumbnail) attr - string || array (see get_the_post_thumbnail) echo - bool (true or false) - whether to echo the image or return it */
Example Usage:
<?php //Assuming $post is in scope if (function_exists ( 'mt_profile_img' ) ) { $author_id=$post->post_author; mt_profile_img( $author_id, array( 'size' => 'thumbnail', 'attr' => array( 'alt' => 'Alternative Text' ), 'echo' => true ) ); } ?>
Since 2.2.0, you can add a profile author box using function mt_author_box
.
<?php mt_author_box( $post->post_author, array( 'theme' => 'tabbed', 'profileAvatarShape' => 'round', 'showWebsite' => true, 'website' => 'https://www.ronalfy.com', 'showSocialMedia' => true, 'socialMediaOptions' => 'brand', 'socialWordPress' => 'https://profiles.wordpress.org/ronalfy', 'socialFacebook' => 'https://facebook.com/mindefusement', ) );
View the code on GitHub.
The REST API is currently supported for versions of WordPress 4.4 and up.
Author or greater.
As of 1.5, three image sizes are created: profile_24, profile_48, and profile_96. You are not limited to these sizes, however.
Yes, but you’ll have to set a new profile image per site. This is currently a limitation of the way the plugin stores its data. Ideas to overcome this are welcome.
mpp_avatar_classes
filter to get_avatar override to allow global class overrides/additions.