Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#46410 closed defect (bug) (fixed)

Twenty Nineteen: Invalid check for twentynineteen_get_user_avatar_markup

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

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 7 years ago.
Patch.

Download all attachments as: .zip

Change History (8)

#1 @tobifjellner
7 years ago

  • Severity criticalnormal

#2 @mukesh27
7 years ago

  • Component ThemesBundled 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
7 years ago

Patch.

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


7 years ago

#4 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review5.3

#5 @SergeyBiryukov
7 years ago

  • Summary Invalid check for twentynineteen_get_user_avatar_markup in twentynineteenTwenty Nineteen: Invalid check for twentynineteen_get_user_avatar_markup

#6 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

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
7 years ago

#47496 was marked as a duplicate.

Note: See TracTickets for help on using tickets.