Posted By

alp on 06/06/11


Tagged

wordpress Gravatar functionsphp


Versions (?)

Wordpress: add a default-gravatar to options


 / Published in: PHP
 

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

  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. }

Report this snippet  

You need to login to post a comment.