This plugin integrates the Adorable Avatars avatar placeholder service into WordPress.
- Download ZIP.
- Upload contents to the
/wp-content/plugins
directory on your web server. - Activate the plugin through the Plugins menu in WordPress.
- Select Adorable Avatars as default avatar setting on the Discussion Settings page in your WordPress back end.
Need to customize anything? Just use the provided filters.
In case you want to have Adorable Avatars all over your site (i.e., not only as default when there is no Gravatar), use this filter.
Arguments:
bool
$force
Force Adorable Avatars?mixed
$id_or_email
User identifier.array
$args
Avatar args.
Usage Example:
Use Adorable Avatars no matter what:
<?php
add_filter( 'adorable_avatars.force', '__return_true' );
Use Adorable Avatars for anyone but the user with ID 42:
<?php
add_filter( 'adorable_avatars.force', function ( $force, $id_or_email ) {
if ( is_numeric( $id_or_email ) ) {
$id_or_email = (int) $id_or_email;
} elseif ( $id_or_email instanceof WP_Post ) {
$id_or_email = $id_or_email->ID;
} elseif ( $id_or_email instanceof WP_Comment ) {
$id_or_email = $id_or_email->user_id;
}
return 42 !== $id_or_email;
}, 10, 2 );
Default Avatar setting - Here you can select Adorable Avatars as default avatar setting.
If you have a feature request, or if you have developed the feature already, please feel free to use the Issues and/or Pull Requests section.
Of course, you can also provide me with translations if you would like to use the plugin in another not yet included language.
Copyright (c) 2016 Thorsten Frommen
This code is licensed under the MIT License.