diff --git a/php/class-coauthors-plus.php b/php/class-coauthors-plus.php index 57896031..094639d6 100644 --- a/php/class-coauthors-plus.php +++ b/php/class-coauthors-plus.php @@ -1826,6 +1826,15 @@ public function filter_pre_get_avatar_data_url( $args, $id ) { return $args; } + // Do not filter on the post list screen, profile screen, and post takeover pop-up. + if ( isset( $current_screen->base ) && ( 'post' === $current_screen->base || 'profile' === $current_screen->base || 'edit' === $current_screen->base ) ) { + return $args; + } + + // Do not filter the avatar if this is doing a heartbeat request on WP refresh lock. + if ( wp_doing_ajax() && isset( $_POST['action'] ) && 'heartbeat' === $_POST['action'] ) { + return $args; + } $coauthor = $this->get_coauthor_by( 'id', $id ); if ( false !== $coauthor && isset( $coauthor->type ) && 'guest-author' === $coauthor->type ) {