Using a function written in my functions.php file in the header.php file

I was asked to work on a site where the former developer had written this function (create a variable that stores the avatar of the user in an img tag) in the functions file. php:

add_filter (& # 39; get_avatar & # 39; lb_acf_profile_avatar & # 39 ;, 10, 5);
function lb_acf_profile_avatar ($ avatar, $ id_or_email, $ size, $ default, $ alt) {

$ user = "http://wordpress.stackexchange.com/";
// Get the user by username or email
if (is_numeric ($ id_or_email)) {
$ id = (int) $ id_or_email;
$ user = get_user_by ('id', $ id);
} elseif (is_object ($ id_or_email)) {
if (! empty ($ id_or_email-> user_id)) {
$ id = (int) $ id_or_email-> user_id;
$ user = get_user_by ('id', $ id);
}
} other {
$ user = get_user_by (& # 39; email, $ id_or_email);
}
if (! $ user) {
back $ avatar;
}
// Retrieves the user ID
$ user_id = $ user-> ID;
// $ user_info = get_userdata ($ user_id)
// Get the file identifier
$ avatar_url = $ user-> get (& # 39; user_url & # 39;); //'https://dojo.nearsoft.com/wp-content/uploads/2017/02/Eric-Wroolie-per-template.jpg & # 39 ;;
if ($ avatar_url == "http://wordpress.stackexchange.com/") {
back $ avatar;
}
$ avatar = & # 39;http://wordpress.stackexchange.com/ ". $ alt." http://wordpress.stackexchange.com/ "src =" http://wordpress.stackexchange.com/ ". $ avatar_url." http: // wordpress.stackexchange.com/ "class =" avatar avatar- & # 39 ;. size $. "http://wordpress.stackexchange.com/" height = "http://wordpress.stackexchange.com/". size $. "http://wordpress.stackexchange.com/" width = "http://wordpress.stackexchange.com/". size $. "http://wordpress.stackexchange.com/" /> & # 39 ;;
// return our new avatar
back $ avatar;
}
</code></pre>
<p>I know that the function works because the application that he built uses the code to generate each user's avatar. I just do not know how to use it and I can not talk to him to help him use it.</p>
<p>My efforts have so far failed, using a code that looks a bit like this:</p>
<pre><code><?php lb_acf_profile_avatar() ?>
<?php if ($avatar != 
    
Hellow World

Where I tried to call the function, assuming that the returned variable (the image of the avatar) would be usable from that point. This does not seem to be the case.

The error message is 5 of these for each argument:

Warning: Argument 5 missing for lb_acf_profile_avatar (), called in /home/materialshub/public_html/development/wp-content/themes/bolt/header.php at line 238 and defined in / home / materialshub / public_html / development / wp- happy. /themes/bolt/functions.php on line 663 

Is there a way to adapt this to get avatar_url without the returned img tag, but I need the original code to work as it should, because it is also used in the application and works properly.

I do not have access to the application. Or the old developer. Any help you can provide is excellent. If you want more information, let me know.

I think I want a new function that gets the avatar_url as the function above, but without any img tags. A simple URL is everything I need.

I need it to be dynamic too so that it works automatically for all users, generating avatar_url. How can I pass the arguments in this mansion?

I can not just use the built-in get_avatar () function of WordPress before trying to follow this route because the application uses an empty field in the database 'user_url'.

I like this question quite annoyingly, but I appreciate his kindness.

EDIT: I've tried to get back to the get_avatar () function, then this warning is returned:

Warning: Missing Argument 1 for get_avatar (), called in /home/materialshub/public_html/development/wp-content/themes/bolt/header.php on line 239 and defined in / home / materialshub / public_html / development / wp- includes /pluggable.php on line 2450

Thank you, Jason