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

@ -114,10 +114,10 @@ class OpalEstate_Agency {
/** /**
* Get url of user avatar by agency id * 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 );; $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 ) { if( $url ) {
return $url; return $url;

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

@ -1,4 +1,4 @@
=== Opal Estate Pro === === Opal Estate Pro - Portal for posting property ===
Contributors: wpopal Contributors: wpopal
Donate link: http://www.wpopal.com/product/opal-estate-wordpress-plugin/ Donate link: http://www.wpopal.com/product/opal-estate-wordpress-plugin/
Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace

@ -25,10 +25,10 @@
if ( $post->post_type == 'opalestate_agency' ) { if ( $post->post_type == 'opalestate_agency' ) {
$prefixs = OPALESTATE_AGENCY_PREFIX; $prefixs = OPALESTATE_AGENCY_PREFIX;
$picture = OpalEstate_Agency::get_avatar_url( $post->ID ); $picture = OpalEstate_Agency::get_avatar_url( $post->ID , 'full' );
} else { } else {
$prefixs = OPALESTATE_AGENT_PREFIX; $prefixs = OPALESTATE_AGENT_PREFIX;
$picture = OpalEstate_Agent::get_avatar_url( $post->ID ); $picture = OpalEstate_Agent::get_avatar_url( $post->ID , 'full' );
} }
$trusted = get_post_meta( $related, $prefixs . 'trusted', true ); $trusted = get_post_meta( $related, $prefixs . 'trusted', true );
@ -39,10 +39,10 @@
if ( $post->post_type == 'opalestate_agency' ) { if ( $post->post_type == 'opalestate_agency' ) {
$prefixs = OPALESTATE_AGENCY_PREFIX; $prefixs = OPALESTATE_AGENCY_PREFIX;
$picture = OpalEstate_Agency::get_avatar_url( $post->ID ); $picture = OpalEstate_Agency::get_avatar_url( $post->ID , 'full' );
} else { } else {
$prefixs = OPALESTATE_AGENT_PREFIX; $prefixs = OPALESTATE_AGENT_PREFIX;
$picture = OpalEstate_Agent::get_avatar_url( $post->ID ); $picture = OpalEstate_Agent::get_avatar_url( $post->ID, 'full' );
} }
$trusted = get_post_meta( $related, $prefixs . 'trusted', true ); $trusted = get_post_meta( $related, $prefixs . 'trusted', true );