This commit is contained in:
Hoang Huu
2019-10-03 10:13:42 +07:00
4 changed files with 14 additions and 9 deletions

View File

@@ -114,10 +114,10 @@ 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, $size='thumbnail' ) {
$id = get_post_meta( $userID, OPALESTATE_AGENCY_PREFIX . 'avatar_id', true );;
$url = wp_get_attachment_image_url( $id, 'thumbnail' );
$url = wp_get_attachment_image_url( $id, $size );
if( $url ) {
return $url;

View File

@@ -87,8 +87,13 @@ class OpalEstate_Agent {
/**
* Get url of user avatar by agent id
*/
public static function get_avatar_url( $userID ) {
return get_post_meta( $userID, OPALESTATE_AGENT_PREFIX . "avatar", true );
public static function get_avatar_url( $userID, $size='thumbnail' ) {
$id = get_post_meta( $userID, OPALESTATE_AGENT_PREFIX . 'avatar_id', true );;
$url = wp_get_attachment_image_url( $id, $size );
if( $url ) {
return $url;
}
}
/**