Avatar wordrpess

https://www.hungred.com/how-to/customize-wordpress-avatar-filter-hook/

if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
		$myavatar = get_template_directory_uri() . '/assets/images/girl.png';
		update_option( 'avatar_default' , $myavatar ); // set the new avatar to be the default 
	});
function mytheme_addgravatar( $avatar_defaults ) {
		$myavatar1 = get_template_directory_uri() . '/assets/images/girl.png';
		$avatar_defaults[$myavatar1] = 'New Gravatar 1';
		return $avatar_defaults;
	}
	add_filter( 'avatar_defaults', 'mytheme_addgravatar');

Last updated