Wordpress: add a default-gravatar to options


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2.  * add a default-gravatar to options
  3.  * http://wpengineer.com/502/add-avatar-to-wordpress-default/
  4.  */
  5.  
  6. if ( !function_exists('myfunction_add_gravatar') ) {
  7. function myfunction_add_gravatar( $avatar_defaults ) {
  8. $myavatar = get_bloginfo('template_directory') . '/images/icons/my_avatar.png';
  9. $avatar_defaults[$myavatar] = 'My Avatar';
  10. return $avatar_defaults;
  11. }
  12.  
  13. add_filter( 'avatar_defaults', 'myfunction_add_gravatar' );
  14. }

URL: http://wpengineer.com/502/add-avatar-to-wordpress-default/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.