WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 17 months ago

Last modified 17 months ago

#46410 closed defect (bug) (fixed)

Twenty Nineteen: Invalid check for twentynineteen_get_user_avatar_markup

Reported by: Diego La Monica Owned by: 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 20 months ago.
Patch.

Download all attachments as: .zip

Change History (8)

#1 @tobifjellner
20 months ago

  • Severity changed from critical to normal

#2 @mukesh27
20 months 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
20 months ago

Patch.

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


17 months ago

#4 @SergeyBiryukov
17 months ago

  • Milestone changed from Awaiting Review to 5.3

#5 @SergeyBiryukov
17 months 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
17 months 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
17 months ago

#47496 was marked as a duplicate.

Note: See TracTickets for help on using tickets.