/** * get_author_image() * * @param int $author_id * @param null $width * @param null $height * @return string $image */ static function get_author_image($author_id, $width = null, $height = null, $avatar = false) { $author_image = author_image::get_author_image_url($author_id); if ($author_image != '') { $author_name = author_image::get_author_name($author_id); $image_class = ''; if ($avatar) { $image_class = 'class="avatar photo"'; } if (!empty($width)) { if (empty($height)) { $height = $width; } $author_image = '<img src="' . esc_url($author_image) . '" ' . $image_class . ' alt="' . $author_name . '" width="' . $width . '" height="' . $height . '" />'; } else { $author_image = '<img src="' . esc_url($author_image) . '" ' . $image_class . ' alt="' . $author_name . '" />'; } } return $author_image; }
/** * get_author_image() * * @param int $author_id * @param null $width * @param null $height * @return string $image */ static function get_author_image($author_id, $width = null, $height = null) { $author_image = author_image::get_author_image_url($author_id); if ($author_image != '') { $author_name = author_image::get_author_name($author_id); if (!empty($width)) { if (empty($height)) { $height = $width; } $author_image = '<img src="' . esc_url($author_image) . '" alt="' . $author_name . '" width="' . $width . '" height="' . $height . '" />'; } else { $author_image = '<img src="' . esc_url($author_image) . '" alt="' . $author_name . '" />'; } } return $author_image; }