This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add new avatar to be select as a default | |
* | |
* @since 1.0.0 | |
* @param array $defaults | |
* @return array | |
*/ | |
function ja_add_avatar_default( $defaults ) { | |
$new = get_stylesheet_directory_uri() . '/images/default-avatar.jpg'; | |
$defaults[$new] = "Custom Default"; | |
return $defaults; | |
} | |
add_filter( 'avatar_defaults', 'ja_add_avatar_default' ); |
Questions, comments, or suggestion for improvement? Leave a comment on the GitHub Gist page.