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

    r47122 r47886  
    4747                <footer class="entry-meta">
    4848                        <?php $show_sep = false; ?>
     49
    4950                        <?php
    50                                 /* translators: Used between list items, there is a space after the comma. */
    51                                 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     51                        /* translators: Used between list items, there is a space after the comma. */
     52                        $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     53
    5254                        if ( $categories_list ) :
    5355                                ?>
     
    6062                        </span>
    6163                        <?php endif; // End if categories. ?>
     64
    6265                        <?php
    63                                 /* translators: Used between list items, there is a space after the comma. */
    64                                 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    65                         if ( $tags_list ) :
     66                        /* translators: Used between list items, there is a space after the comma. */
     67                        $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     68
     69                        if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    6670                                if ( $show_sep ) :
    6771                                        ?>
Note: See TracChangeset for help on using the changeset viewer.