make get_default_profile_photo() pluggable

This commit is contained in:
zotlabs 2018-05-14 23:10:20 -07:00
parent 062dea8e13
commit 803e85caeb

View File

@ -1776,6 +1776,17 @@ function get_default_profile_photo($size = 300) {
if(! $scheme) if(! $scheme)
$scheme = 'rainbow_man'; $scheme = 'rainbow_man';
if(! is_dir('images/default_profile_photos/' . $scheme)) {
$x = [ 'scheme' => $scheme, 'size' => $size, 'url' => '' ];
call_hooks('default_profile_photo',$x);
if($x['url']) {
return $x['url'];
}
else {
$scheme = 'rainbow_man';
}
}
return 'images/default_profile_photos/' . $scheme . '/' . $size . '.png'; return 'images/default_profile_photos/' . $scheme . '/' . $size . '.png';
} }