Skip to content

Commit

Permalink
Helper function to get avatars now respects the show_avatar option fo…
Browse files Browse the repository at this point in the history
…r special cases, fixes #518
  • Loading branch information
Japh committed May 10, 2014
1 parent d4edd9b commit d75aa4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-wp-stream-author.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ function get_agent() {
* @return string
*/
function get_avatar_img( $size = 80 ) {
if ( ! get_option( 'show_avatars' ) ) {
return false;
}

if ( 0 === $this->id ) {
$url = WP_STREAM_URL . 'ui/stream-icons/wp-cli.png';
$avatar = sprintf( '<img alt="%1$s" src="%2$s" class="avatar avatar-%3$s photo" height="%3$s" width="%3$s">', esc_attr( $this->get_display_name() ), esc_url( $url ), esc_attr( $size ) );
Expand Down

0 comments on commit d75aa4a

Please sign in to comment.