make get_default_profile_photo() pluggable
This commit is contained in:
parent
062dea8e13
commit
803e85caeb
@ -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';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user