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

    r47808 r47886  
    5353        <footer class="entry-meta">
    5454            <?php $show_sep = false; ?>
     55
    5556            <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported. ?>
    5657                <?php
    5758                /* translators: Used between list items, there is a space after the comma. */
    5859                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     60
    5961                if ( $categories_list ) :
    6062                    ?>
     
    6870                <?php endif; // End if categories. ?>
    6971            <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ). ?>
     72
    7073            <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported. ?>
    7174                <?php
    7275                /* translators: Used between list items, there is a space after the comma. */
    7376                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    74                 if ( $tags_list ) :
     77
     78                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    7579                    if ( $show_sep ) :
    7680                        ?>
Note: See TracChangeset for help on using the changeset viewer.