Make WordPress Core


Ignore:
Timestamp:
06/02/2020 05:03:06 PM (4 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/twentythirteen/functions.php

    r47808 r47886  
    490490
    491491        /* translators: Used between list items, there is a space after the comma. */
    492         $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
    493         if ( $tag_list ) {
    494             echo '<span class="tags-links">' . $tag_list . '</span>';
     492        $tags_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
     493        if ( $tags_list && ! is_wp_error( $tags_list ) ) {
     494            echo '<span class="tags-links">' . $tags_list . '</span>';
    495495        }
    496496
Note: See TracChangeset for help on using the changeset viewer.