diff --git a/inc/agency/class-opalestate-agency.php b/inc/agency/class-opalestate-agency.php index 64b32265..bb73c90f 100755 --- a/inc/agency/class-opalestate-agency.php +++ b/inc/agency/class-opalestate-agency.php @@ -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; diff --git a/inc/agent/class-opalestate-agent.php b/inc/agent/class-opalestate-agent.php index e86329b8..0bcaaa77 100755 --- a/inc/agent/class-opalestate-agent.php +++ b/inc/agent/class-opalestate-agent.php @@ -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; + } } /** diff --git a/readme.txt b/readme.txt index b3ffc924..9d6775a5 100755 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -=== Opal Estate Pro === +=== Opal Estate Pro - Portal for posting property === Contributors: wpopal 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 diff --git a/templates/single-property/user/author-user-box.php b/templates/single-property/user/author-user-box.php index b26ea82c..e4030ef4 100755 --- a/templates/single-property/user/author-user-box.php +++ b/templates/single-property/user/author-user-box.php @@ -25,10 +25,10 @@ if ( $post->post_type == 'opalestate_agency' ) { $prefixs = OPALESTATE_AGENCY_PREFIX; - $picture = OpalEstate_Agency::get_avatar_url( $post->ID ); + $picture = OpalEstate_Agency::get_avatar_url( $post->ID , 'full' ); } else { $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 ); @@ -39,10 +39,10 @@ if ( $post->post_type == 'opalestate_agency' ) { $prefixs = OPALESTATE_AGENCY_PREFIX; - $picture = OpalEstate_Agency::get_avatar_url( $post->ID ); + $picture = OpalEstate_Agency::get_avatar_url( $post->ID , 'full' ); } else { $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 );