Skip to content

Commit

Permalink
[ Bug fix ] Fix profile image warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kurudrive committed Dec 7, 2024
1 parent d12fa29 commit 2448229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Display to Post Author Information Box on bottom of the contents.

== Changelog ==

[ Bug fix ] Fix profile image warning

= 1.25.0 =
[ Add function ] Add a feature that allows specifying the tag.

Expand Down
6 changes: 4 additions & 2 deletions view.post-author.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public static function pad_get_author_profile() {
$profile_image_id = get_the_author_meta( 'user_profile_image' );
if ( $profile_image_id ) {
$profile_image_src = wp_get_attachment_image_src( $profile_image_id, 'thumbnail' );
$profile_unit .= '<img src="' . $profile_image_src[0] . '" alt="' . $user_name . '" />';
}
if ( isset( $profile_image_src ) && is_array( $profile_image_src ) ) {
$profile_unit .= '<img src="' . $profile_image_src[0] . '" alt="' . $user_name . '" />';
} else {
$profile_unit .= get_avatar( get_the_author_meta( 'email' ), 100 );
}
Expand Down Expand Up @@ -189,7 +191,7 @@ public static function pad_get_author_box( $layout = 'normal' ) {
$author_unit = '<section class="padSection" id="padSection">';

if ( 'author_archive' !== $layout ) {
$author_unit .= '<'. esc_html( $options['author_box_title_tag'] ) .' class="padSectionTitle">' . esc_html( $options['author_box_title'] ) . '</'. esc_html( $options['author_box_title_tag'] ) .'>';
$author_unit .= '<' . esc_html( $options['author_box_title_tag'] ) . ' class="padSectionTitle">' . esc_html( $options['author_box_title'] ) . '</' . esc_html( $options['author_box_title_tag'] ) . '>';
}

$author_unit .= self::pad_get_author_profile();
Expand Down

0 comments on commit 2448229

Please sign in to comment.