Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#46410 closed defect (bug) (fixed)

Twenty Nineteen: Invalid check for twentynineteen_get_user_avatar_markup

Reported by: diego-la-monica's profile Diego La Monica Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: dev-feedback has-patch good-first-bug
Focuses: template Cc:

Description

Hi all folks,

I've found a small bug in twentynineteen theme.

In file inc/template-tags.php @ row 169 the check for the function is wrong.
Indeed the nested function is twentynineteen_get_user_avatar_markup and not as wrongly reported twentynineteen_comment_avatar.

Follows the excerpt:

<?php
if ( ! function_exists( 'twentynineteen_comment_avatar' ) ) :
        /**
         * Returns the HTML markup to generate a user avatar.
         */
        function twentynineteen_get_user_avatar_markup( $id_or_email = null ) {

                if ( ! isset( $id_or_email ) ) {
                        $id_or_email = get_current_user_id();
                }

                return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) );
        }
endif;

Attachments (1)

46410.diff (575 bytes) - added by mukesh27 6 years ago.
Patch.

Download all attachments as: .zip

Change History (8)

#1 @tobifjellner
6 years ago

  • Severity changed from critical to normal

#2 @mukesh27
6 years ago

  • Component changed from Themes to Bundled Theme
  • Keywords has-patch good-first-bug added; needs-patch removed

Hi @diego-la-monica, Welcome to WordPress Trac! Thanks for the report.

good caught it's small bug that will fix in next update.

@mukesh27
6 years ago

Patch.

This ticket was mentioned in Slack in #core by sergey. View the logs.


5 years ago

#4 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.3

#5 @SergeyBiryukov
5 years ago

  • Summary changed from Invalid check for twentynineteen_get_user_avatar_markup in twentynineteen to Twenty Nineteen: Invalid check for twentynineteen_get_user_avatar_markup

#6 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45383:

Twenty Nineteen: Correct function name in a function_exists() check for twentynineteen_get_user_avatar_markup().

Props mukesh27, diego-la-monica.
Fixes #46410.

#7 @SergeyBiryukov
5 years ago

#47496 was marked as a duplicate.

Note: See TracTickets for help on using tickets.