Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions php/class-coauthors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a nonce that can be verified here for the heartbeat?
(PHPCS failure)

return $args;
}

$coauthor = $this->get_coauthor_by( 'id', $id );
if ( false !== $coauthor && isset( $coauthor->type ) && 'guest-author' === $coauthor->type ) {
Expand Down