Sections
Personal tools
You are here: Home

User Profile Picture Plugin WordPress, Télécharger, Installer

User Profile Picture Plugin WordPress

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

User Profile Picture Télécharger Maintenant

Télécharger Maintenant

(Si le lien ne fonctionne pas)↓

Lien Originals WordPress.org

https://wordpress.org/plugins/metronet-profile-picture/

Comment Installer User Profile Picture Plugin, Manually

  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 or Site-specific plugin:

add_filter( 'mpp_avatar_override', '__return_true' );

If you want to hide the “Override Avatar” checkbox, use this filter (the override functionality will be enabled by default):

add_filter( 'mpp_hide_avatar_override', '__return_true' );

The REST API is currently supported for versions of WordPress 4.4 and up.

The endpoint is: http://www.yourdomain.com/wp-json/mpp/v1/user/{user_id}

If a profile picture is found, it’ll return JSON as follows:

{"attachment_id":"3638","attachment_url":"http://localhost/ronalfy/wp-content/uploads/2015/12/Leaderboard-All-Time.png"}

Vidéo

Captures d’écran

User Profile Picture Plugin WordPress

User Profile Picture Plugin WordPress

Le plugin ne fonctionne pas?

En cas d’erreurs ou de problèmes avec le plug-in, écrivez des commentaires.

Titre: Wordpress Plugin , , , , .
Document Actions
SysML France