Make WordPress Core


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

    r47122 r47886  
    7171        <footer class="entry-meta">
    7272                <?php $show_sep = false; ?>
     73
    7374                <?php
    74                         /* translators: Used between list items, there is a space after the comma. */
    75                         $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     75                /* translators: Used between list items, there is a space after the comma. */
     76                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     77
    7678                if ( $categories_list ) :
    7779                        ?>
     
    8486                </span>
    8587                <?php endif; // End if categories. ?>
     88
    8689                <?php
    87                         /* translators: Used between list items, there is a space after the comma. */
    88                         $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    89                 if ( $tags_list ) :
     90                /* translators: Used between list items, there is a space after the comma. */
     91                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     92
     93                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    9094                        if ( $show_sep ) :
    9195                                ?>
Note: See TracChangeset for help on using the changeset viewer.