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-image.php

    r47122 r47886  
    5656            <div class="entry-meta">
    5757                <?php
    58                     /* translators: Used between list items, there is a space after the comma. */
    59                     $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     58                /* translators: Used between list items, there is a space after the comma. */
     59                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     60
    6061                if ( $categories_list ) :
    6162                    ?>
     
    6768                </span>
    6869                <?php endif; // End if categories. ?>
     70
    6971                <?php
    70                     /* translators: Used between list items, there is a space after the comma. */
    71                     $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    72                 if ( $tags_list ) :
     72                /* translators: Used between list items, there is a space after the comma. */
     73                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     74
     75                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    7376                    ?>
    7477                <span class="tag-links">
Note: See TracChangeset for help on using the changeset viewer.