<?php
/**
 * Discord
 *
 * @package um_ext\um_social_login\core
 */

/**
 * Set default avatar when there's no avvatar from getUserProfile()
 *
 * @param object $user_profile User Profile object.
 */
function um_social_login_get_user_profile__discord( $user_profile ) {

	if ( ! isset( $user_profile->photoURL ) || empty( $user_profile->photoURL ) ) { //phpcs:ignore
		$user_profile->photoURL = 'https://cdn.discordapp.com/embed/avatars/0.png';  //phpcs:ignore
	}

	return $user_profile;
}
add_filter( 'um_social_login_get_user_profile__discord', 'um_social_login_get_user_profile__discord', 10 );
