Skip to content

Commit

Permalink
Merge pull request #959 from thoughtis/issue#958/avatar-sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones committed Jul 29, 2023
2 parents 759f992 + 72d63cb commit e0485ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions co-authors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class CoAuthors_Plus {
var $coauthors_meta_box_name = 'coauthorsdiv';
var $force_guest_authors = false;

var $gravatar_size = 25;

var $_pages_whitelist = array( 'post.php', 'post-new.php', 'edit.php' );

var $supported_post_types = array();
Expand Down Expand Up @@ -453,7 +451,7 @@ public function coauthors_meta_box( $post ) {
$avatar_url = get_avatar_url( $coauthor->ID, array( 'user_type' => $user_type ) );
?>
<li>
<?php echo get_avatar( $coauthor->ID, $this->gravatar_size ); ?>
<?php echo get_avatar( $coauthor->ID ); ?>
<span id="<?php echo esc_attr( 'coauthor-readonly-' . $count ); ?>" class="coauthor-tag">
<input type="text" name="coauthorsinput[]" readonly="readonly" value="<?php echo esc_attr( $coauthor->display_name ); ?>" />
<input type="text" name="coauthors[]" value="<?php echo esc_attr( $coauthor->user_login ); ?>" />
Expand Down Expand Up @@ -1863,11 +1861,11 @@ public function filter_pre_get_avatar_data_url( $args, $id ) {
$coauthor = $this->get_coauthor_by( 'id', $id );
if ( false !== $coauthor && isset( $coauthor->type ) && 'guest-author' === $coauthor->type ) {
if ( has_post_thumbnail( $id ) ) {
$args['url'] = get_the_post_thumbnail_url( $id, $this->gravatar_size );
$args['url'] = get_the_post_thumbnail_url( $id, array( $args['width'], $args['height'] ) );
} elseif ( isset( $coauthor->user_email ) ) {
$args['url'] = get_avatar_url( $coauthor->user_email );
$args['url'] = get_avatar_url( $coauthor->user_email, $args );
} else {
$args['url'] = get_avatar_url( '' ); // Fallback to default.
$args['url'] = get_avatar_url( '', $args ); // Fallback to default.
}
}
return $args;
Expand Down
2 changes: 2 additions & 0 deletions css/co-authors-plus.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
}
#coauthors-readonly ul li .avatar {
float: left;
width: 25px;
height: 25px;
}
#coauthors-readonly ul li .coauthor-tag {
display:block;
Expand Down

0 comments on commit e0485ac

Please sign in to comment.