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%
View Admin As
The ultimate User switcher and Role manager This plugin will add a menu item to your admin bar where you can change your view in the WordPress admin. Switch to other users without the need to login as that user or even switch roles and temporarily change your own capabilities. When you’re viewing as a different user, you can also change this user’s preferences; like screen settings on various admin pages. With the “Role defaults” module you can set default screen settings and metabox locations for roles and apply them to users through various bulk actions. It also features a “Role manager” module to add, edit or remove roles and grant or deny them capabilities. Overview / Features Switch between user accounts Edit this user’s screen preferences and settings Switch between roles Temporarily change your own capabilities (non-destructively) View your site as an unregistered visitor Switch language/locale on backend and frontend Make combinations of the above view types Easily switch back anytime Completely secure (see Security below) Do all the above without logging out! Module: Role defaults (screen settings) Set default screen settings for roles Apply defaults to a user Apply defaults to all users of a role Apply defaults when registering a new user (in a multisite this is done when a user is added to its first blog) Copy defaults from one role to another (or multiple) Import/Export role defaults, can also download (and upload) setting files Disable the “screen settings” option and/or lock the meta boxes for all users that don’t have access to this plugin Click here for Role Defaults documentation Module: Role manager (role editor) Note: Changes made with the Role Manager are permanent! Add, edit or delete roles Grant and/or add capabilities to roles Rename roles Clone roles Import/Export roles, can also download (and upload) setting files Update role capabilities from current view Automatically migrate users to another role after deleting a role Click here for Role Manager documentation Compatibility & Integrations This plugin will work with most other plugins but these are tested: Advanced Access Manager (Pro version not verified) bbPress BuddyPress Genesis Framework (and probably other theme frameworks) Google Site Kit Gravity Forms Groups 2.1+ (Custom integration: adds a view type for groups. Pro version not tested) Pods Framework 2.0+ Members Restrict User Access 0.13+ (Custom integration: adds a view type for access levels) User Roles and Capabilities User Role Editor (Pro version not verified) User Switching (Not sure why you’d want this but yes, switch-ception is possible!) WPFront User Role Editor WP Admin UI Customize 1.5.11+ Yoast SEO Full list of tested plugins and details: Compatibility & Integrations I can’t switch back! See item 3 at FAQ. It’s not working! / I found a bug! Please let me know through the support and add a plugins and themes list! 🙂 Security This plugin is completely safe and will keep your users, passwords and data secure. For more info see item 7 at FAQ! Developer notes This plugin will only be useful for admins (network super admins or regular admins). It will not add functionalities for other roles unless you specifically apply custom capabilities for those users. Also keep in mind that switching to users that have equal roles is disabled. (regular admins to regular admins + super admins to super admins) I’ve created this at first for myself since I’m a developer and often need to see the outcome on roles which my clients use. So, when you are developing a plugin or theme that does anything with roles or capabilities you can use this plugin to easily check if everything works. No more hassle of creating test users and constantly logging out and in anymore! This plugin is also useful to support your clients and/or users. For example; make screen display presets of the edit and overview pages before you let them log in. You can find me here: Keraweb GitHub LinkedIn Translations Please help translating this plugin on translate.wordpress.org! Actions & Filters Click here for Action documentation Click here for Filter documentation Plugin capabilities Click here for documentation Ideas? Please let me know on GitHub!