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/twentyeleven/content-featured.php

    r47808 r47886  
    3434        <?php
    3535        /* translators: Used between list items, there is a space after the comma. */
    36         $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     36        $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    3737
    38         if ( '' !== $tag_list ) {
     38        if ( $tags_list && ! is_wp_error( $tags_list ) ) {
    3939            /* translators: 1: Category list, 2: Tag list, 3: Post permalink, 4: Post title. */
    4040            $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
     
    4848            /* translators: Used between list items, there is a space after the comma. */
    4949            get_the_category_list( __( ', ', 'twentyeleven' ) ),
    50             $tag_list,
     50            $tags_list,
    5151            esc_url( get_permalink() ),
    5252            the_title_attribute( 'echo=0' )
Note: See TracChangeset for help on using the changeset viewer.