Skip to content

Commit

Permalink
Simplifies method to get author avatar in the Divi integration
Browse files Browse the repository at this point in the history
  • Loading branch information
andergmartins committed May 5, 2020
1 parent 82a9a8a commit cf1075a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/modules/divi-integration/divi-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,10 @@ public function resolveDefaultDynamicContent($content, $name, $settings, $post_i
break;
}

$avatarImgTag = $author->get_avatar();
// Extract only the URL.
preg_match('/src=[\'"]([^\'"]+)[\'"]/', $avatarImgTag, $matches);
if (is_array($matches) && ! empty($matches)) {
$content = $matches[1];
$content = $author->get_avatar_url();
if (is_array($content)) {
$content = $content['url'];
}
break;
}

// Handle in post type URL options.
Expand Down

0 comments on commit cf1075a

Please sign in to comment.