Skip to content

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson1000 committed Oct 31, 2024
1 parent 75dc720 commit f4dfd9d
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@
use MOJ\Intranet\Authors;

// Parse template args.
$show_excerpt = isset($args['show_excerpt']) ? $args['show_excerpt'] : true;
$show_excerpt = !isset($args['show_excerpt']) || $args['show_excerpt'];

$id = $post->ID;
$thumbnail = get_the_post_thumbnail_url($id, 'user-thumb');
$thumbnail_alt = get_post_meta(get_post_thumbnail_id($id), '_wp_attachment_image_alt', true);

$oAuthor = new Authors();
$authors = $oAuthor->getAuthorInfo($id);

$author = $authors[0] ?? false;
$author_display_name = $author['name'] ?? false;
$thumbnail = get_the_post_thumbnail_url($id, 'user-thumb');
$thumbnail_alt = get_post_meta(get_post_thumbnail_id($id), '_wp_attachment_image_alt', true);


if (!$thumbnail) {
$thumbnail = $author['thumbnail_url'] ?? false;
Expand Down

0 comments on commit f4dfd9d

Please sign in to comment.