This commit is contained in:
ThemeLexus
2019-10-02 13:34:39 +07:00
parent 4f1e33c9a9
commit 78bf24be34
3 changed files with 37 additions and 5 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 );
}