This commit is contained in:
Hoang Huu
2019-10-02 14:15:17 +07:00
parent ca848a3844
commit e5165308ec
2 changed files with 11 additions and 3 deletions

View File

@@ -114,7 +114,15 @@ class OpalEstate_Agency {
/**
* Get url of user avatar by agency id
*/
public static function get_avatar_url( $userID ) {
public static function get_avatar_url( $userID ) {
$id = get_post_meta( $userID, OPALESTATE_AGENCY_PREFIX . 'avatar_id', true );;
$url = wp_get_attachment_image_url( $id, 'thumbnail' );
if( $url ) {
return $url;
}
return get_post_meta( $userID, OPALESTATE_AGENCY_PREFIX . 'avatar', true );
}