From 6d6cc917aae83e618c35b68c6b5a899636ff0a7c Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Thu, 27 Jul 2023 12:21:12 -0400 Subject: [PATCH 1/4] pass a valid size to get_the_post_thumbnail_url --- co-authors-plus.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/co-authors-plus.php b/co-authors-plus.php index f3d6f0d0..1357f1f7 100755 --- a/co-authors-plus.php +++ b/co-authors-plus.php @@ -1839,7 +1839,7 @@ 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 ); } else { From eb7012ea7a4394563a64c537395cdf51c9f49198 Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Thu, 27 Jul 2023 12:21:51 -0400 Subject: [PATCH 2/4] pass the $args when recursing --- co-authors-plus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/co-authors-plus.php b/co-authors-plus.php index 1357f1f7..aef880d9 100755 --- a/co-authors-plus.php +++ b/co-authors-plus.php @@ -1841,9 +1841,9 @@ public function filter_pre_get_avatar_data_url( $args, $id ) { if ( has_post_thumbnail( $id ) ) { $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; From f5c9ebecdc27f98f23accb9a2ceb74b10379e279 Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Fri, 28 Jul 2023 13:42:01 -0400 Subject: [PATCH 3/4] consistently use WordPress default avatar size --- co-authors-plus.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/co-authors-plus.php b/co-authors-plus.php index aef880d9..f78f7ff2 100755 --- a/co-authors-plus.php +++ b/co-authors-plus.php @@ -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(); @@ -449,7 +447,7 @@ public function coauthors_meta_box( $post ) { $avatar_url = get_avatar_url( $coauthor->ID ); ?>
  • - ID, $this->gravatar_size ); ?> + ID ); ?> From 72d63cb17a0ad814ed84f4daaed51492d7f3c3d5 Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Fri, 28 Jul 2023 13:42:40 -0400 Subject: [PATCH 4/4] apply 25px avatar size for coauthors-readonly --- css/co-authors-plus.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/css/co-authors-plus.css b/css/co-authors-plus.css index 61ad9d5c..a01acce8 100644 --- a/css/co-authors-plus.css +++ b/css/co-authors-plus.css @@ -102,6 +102,8 @@ } #coauthors-readonly ul li .avatar { float: left; + width: 25px; + height: 25px; } #coauthors-readonly ul li .coauthor-tag { display:block;