Help/About: Don't output empty <span> tags on Credits screen.

If the contributor does not have a title, the empty tags are not necessary.

Follow-up to [17877], [17909], [17942], [18162], [19143], [46709].

Props sayedulsayem, audrasjb, mukesh27.
Fixes #54275.

git-svn-id: https://develop.svn.wordpress.org/trunk@51920 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-10-19 23:07:42 +00:00
parent b0cc77854f
commit 40fd54aede

View File

@ -154,7 +154,7 @@ function wp_credits_section_list( $credits = array(), $slug = '' ) {
$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size * 2 ) );
echo '<span class="wp-person-avatar"><img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" /></span>' . "\n";
echo esc_html( $person_data[0] ) . "</a>\n\t";
if ( ! $compact ) {
if ( ! $compact && ! empty( $person_data[3] ) ) {
// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
}