Most membership and local user avatar plugins use a custom meta key and WordPress hooks to override the default get_avatar function. If a user has uploaded a local avatar, these plugins serve the locally stored image instead. Typically, a new meta key (see the table below) is added to the WordPress usermeta table, where the ID or URL of the avatar image is stored.
To address compatibility with these plugins, an option could be added in the Fluent Community admin panel allowing administrators to define a custom meta key for the user avatar. This flexibility would enable the admin to adapt the Fluent Community avatar to work seamlessly with any local avatar or membership plugin. The avatar functionality would retrieve the image based on its ID or URL and allow standard actions like adding or removing the avatar. In essence, it would function as a regular custom meta media field.
The system would also support custom meta keys added to the usermeta table using tools like Advanced Custom Fields (ACF), Meta Box, or JetEngine. This means administrators could easily create their own custom avatar fields and link them to the avatar functionality.
The onus would be on the admin to retrieve the correct meta key from the plugin provider or their own configuration. If no custom meta key is entered, the system would default to the standard avatar configuration. This option might fit best under Advanced Settings.
Below is a list of popular WordPress plugins that manage local avatars and their corresponding meta keys as an example. This demonstrates why it wouldnβt be practical to use a single, predefined meta keyβnaming conventions vary significantly and are not standardised across plugins. The best approach is to allow the admin to add the meta key in Advanced Settings and define whether the meta key stores an ID or a URL. This should cover the majority of use cases.
| Plugin | Meta Key | Description |
|---|---|---|
| Simple Local Avatars | _wp_user_avatar |
Stores the URL or attachment ID of the avatar. |
| WP User Avatar | wp_user_avatar |
Stores the attachment ID or direct URL. |
| Custom User Avatar | user_avatar |
Stores the URL of the avatar. |
| ARMember | avatar |
Stores the URL of the custom avatar. |
| Ultimate Member | um_avatar |
Stores the URL or file path of the avatar. |
| PeepSo | peepso_avatar |
Stores the URL of the avatar. |
| Profile Builder Pro | profile_avatar |
Stores the URL of the avatar. |
| UsersWP | userswp_avatar |
Stores the URL of the avatar. |
This approach provides maximum flexibility for administrators while maintaining compatibility with custom setups using tools like ACF, Meta Box, and JetEngine, ensuring avatars integrate seamlessly with existing meta fields. If no key is provided, the fallback to the default avatar ensures a robust system.
Appreciate your support to upvote this. It something that most admins of membership based websites will need! π
Cheers, Tony
Sidenote - it would be great to see a similar feature added for FluentCRM π