开发者 | aruljayarajs |
---|---|
更新时间 | 2016年6月3日 10:30 |
PHP版本: | 3.0 及以上 |
WordPress版本: | 4.5.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
upload_files
capability, otherwise we need to assign capability to them.
In Front End when we use <?php do_action('edit_user_profile',$current_user); ?>
on edit profile section, it would be placed on additonal user profile fields.
*Future Updates: Display current user images alone, short code and migrate withsocial media profile pictures.
profile-picture
folder to the /wp-content/plugins/
directory<?php add_action('admin_init', array($this,'allow_uploads_permission') ); ?>
from the ProfilePicture
class.Currently, who has the capability of upload_files they can upload profile pictures.
Editors and Admins can upload and edit files.
Authors can only upload files.
Subscribers and Contributors cannot do either Need to enable add_action('admin_init', array($this,'allow_uploads_permission') ) in our class file
.
We can show our customized profile picture in front end whereever you want with registered image sizes. You may use wordpress get_avatar() function by default, else user our customized one it serves by your wish..
<?php $ppimg = ProfilePicture::pp_picture($id_or_email, $width, $height, $alt); ?>
id_or_email (integer|string|object) (required ) You may pass user id, email or user object here.
width (integer) (optional) Width of the image.
height (integer) (optional) Width of the image.
alt (string) (optional) alt title of image tag.
Return Values It would return profile picture details as array or false on failure.