I did manage to achieve the goal, but I had to hardcode the plugin.
I know it is not the best solution, but it will do for now. Here’s how I did it if somebody is wondering:
user-photo.php line 155 to 173 changed
$img = '';
$img .= $before;
$img .= htmlspecialchars($src) . '"';
if(empty($attributes['alt']))
$img .= ' alt="' . htmlspecialchars($userdata->display_name) . '"';
if(empty($attributes['width']) && !empty($width))
$img .= ' width="580"';
if(empty($attributes['height']) && !empty($height))
$img .= ' height="300"';
if(empty($attributes['class']))
$img .= ' class="photo"';
if(!empty($attributes)){
foreach($attributes as $name => $value){
$img .= " $name=\"" . htmlspecialchars($value) . '"';
}
}
$img .= ' />';
$img .= $after;
return $img;
to
$img = htmlspecialchars($src);
return $img;
user-photo.php line 285 changed
echo userphoto__get_userphoto($userid, USERPHOTO_FULL_SIZE, $before, $after, $attributes, $default_src);
to
return(userphoto__get_userphoto($userid, USERPHOTO_FULL_SIZE, $before, $after, $attributes, $default_src));
Now you can call the URL with
userphoto($wp_query->get_queried_object());