Make WordPress Core


Ignore:
Timestamp:
06/02/2020 05:03:06 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Bundled Themes: Consistently check for WP_Error before outputting get_the_tag_list().

Some themes already had these checks in place as a result of [41756], but not others.

Props sixhours, davidakennedy, SergeyBiryukov.
Fixes #39860.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwelve/functions.php

    r47808 r47886  
    502502
    503503        /* translators: Used between list items, there is a space after the comma. */
    504         $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
     504        $tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
    505505
    506506        $date = sprintf(
     
    520520        );
    521521
    522         if ( $tag_list ) {
     522        if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    523523            /* translators: 1: Category name, 2: Tag name, 3: Date, 4: Author display name. */
    524524            $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
     
    534534            $utility_text,
    535535            $categories_list,
    536             $tag_list,
     536            $tags_list,
    537537            $date,
    538538            $author
Note: See TracChangeset for help on using the changeset viewer.