One User Avatar | User Profile Picture
WordPress currently only allows you to use custom avatars that are uploaded through Gravatar. One 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. This plugin is a fork of WP User Avatar v2.2.16. One User Avatar also lets you: Upload your own Default Avatar in your One User Avatar settings. Show the user’s Gravatar avatar or Default Avatar if the user doesn’t have a One User Avatar image. Disable Gravatar avatars and use only local avatars. Use the [avatar_upload] shortcode to add a standalone uploader to a front page or widget. This uploader is only visible to logged-in users. Use the [avatar] shortcode in your posts. These shortcodes will work with any theme, whether it has avatar support or not. Allow Contributors and Subscribers to upload their own avatars. Limit upload file size and image dimensions for Contributors and Subscribers. Copyright One User Avatar Copyright (c) 2023 One Designs https://onedesigns.com/ License: GPLv2 Source: https://github.com/onedesigns/one-user-avatar One User Avatar is based on WP User Avatar v2.2.16 Copyright (c) 2020-2021 ProfilePress https://profilepress.net/ Copyright (c) 2014-2020 Flippercode https://www.flippercode.com/ Copyright (c) 2013-2014 Bangbay Siboliban http://bangbay.com/ License: GPLv2 Source: https://github.com/profilepress/wp-user-avatar One User Avatar is distributed under the terms of the GNU GPL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Advanced Settings Add One User Avatar to your own profile edit page 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, One User Avatar is automatically added to the show_user_profile and edit_user_profile hooks. If you’d rather have One User Avatar in its own section, you could add another hook: do_action( 'edit_user_avatar', $current_user ); Then, to add One 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: function my_avatar_filter() { // Remove from show_user_profile hook remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) ); remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) ); // Remove from edit_user_profile hook remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) ); remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) ); // Add to edit_user_avatar hook add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) ); add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) ); } // Loads only outside of administration panel if ( ! is_admin() ) { add_action( 'init','my_avatar_filter' ); } HTML Wrapper You can change the HTML wrapper of the One User Avatar section by using the functions wpua_before_avatar and wpua_after_avatar. By default, the avatar code is structured like this: Avatar Edit Image Original Size Thumbnail Default Avatar Undo To strip out the div container and h3 heading, you would add the following filters to the functions.php file in your theme: 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: function my_before_avatar() { echo ' '; } add_action( 'wpua_before_avatar', 'my_before_avatar' ); function my_after_avatar() { echo ' '; } add_action( 'wpua_after_avatar', 'my_after_avatar' ); This would output: Edit Image Original Size Thumbnail Default Avatar Undo
Top keywords
- user38×5.35%
- avatar33×4.65%
- avatar'17×2.39%
- action15×2.11%
- user avatar15×2.11%
- add14×1.97%
- 'wpua12×1.69%
- remove9×1.27%
- user avatar'9×1.27%
- avatar' 'wpua8×1.13%
- upload8×1.13%
- edit7×0.99%
Optimum Gravatar Cache
Optimum Gravatar Cache allows you to create a local cache with optimized copies of gravatars. The optimization is accomplished by resizing the avatars to the sizes used on your site, in addition to optimizing the images internally. Optimizations are performed to minimize the size of each avatar served by the plugin. The plugin uses WordPress CRON to perform heavier tasks. Avatars are resized in the background. Avatars are optimized internally in the background. Except in certain cases where it is necessary to resize the avatars in the page request. The plugin handles all your site’s gravatar as long as the wordpress get_avatar() function or buddypress bp_member_avatar() function is used. Works with plugins, themes, etc. The plugin allows you to customize the avatar by default. This avatar is served whenever the user / visitor does not have a custom gravatar. This greatly reduces the number of requests made by your page, improving the user experience. Besides allowing to frame the avatar by default with the theme of your site. The plugin, after being configured and activated, starts by serving gravatar for all. And it begins to create the cache dynamically in the background with the sizes being collected by the requests, as well as those configured on the plug-in page. When the avatar already exists in the cache, the plugin serves the avatar in cache. The plugin periodically checks to see if the user updated their gravatar on gravatar.com if yes is updated locally. This way, keeping an updated cache. The plugin intends the following: Work with the gravatars locally, cache; Reduce the number of requests per page, thus reducing the total time required to load all files. This is achieved because most users do not have a custom gravatar, and for those, only one file needs to be downloaded; Optimize all avatars by reducing their size and transfer time again. Please if you find any bugs of any kind please contact me so that I can solve it as soon as possible. Languages English en_GB (@willstockstech) Portuguese pt_PT (@jomisica) Help translate this plugin into your language Dependencies This plugin depends on the following PHP modules: php-gd or php-imagick (So that it can resize the avatars) php-curl (So that it can communicate with the gravatar using the same connection to update several avatars) The plugin also depends on WordPress CRON to be able to solve the heaviest tasks in the background.
Top keywords
- avatar8×1.97%
- gravatar8×1.97%
- avatars7×