WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Metronet Profile Picture

Set a custom profile image for a user using the standard WordPress media upload tool.

  1. Upload metronet-profile-picture folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Place <?php mt_profile_img() ?> in your templates (arguments and usage are below)
  4. Use the "Override Avatar" function to change your default avatar.

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 )
    );
}
?>

View the code on Pastebin.

The mt_profile_img function internally uses the get_the_post_thumbnail function to retrieve the profile image.

Optionally, if you choose the "Override Avatar" function, you can use get_avatar to retrieve the profile image.

If you want the "Override Avatar" checkbox to be checked by default, drop this into your theme's functions.php file:

add_filter( 'mpp_avatar_override', '__return_true' );

Requires: 3.5 or higher
Compatible up to: 3.6.1
Last Updated: 2013-9-12
Downloads: 14,997

Ratings

4 stars
4.2 out of 5 stars

Support

0 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1
100,1,1 100,1,1 100,1,1 100,2,2
100,1,1
100,1,1
100,2,2 100,2,2 100,1,1
100,2,2 100,1,1 100,2,2
100,1,1
100,1,1 100,1,1
100,2,2
0,1,0
100,1,1