Make WordPress Core


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

    r47808 r47886  
    177177                    <span class="meta-sep">|</span>
    178178                <?php endif; ?>
     179
    179180                <?php
    180                     $tags_list = get_the_tag_list( '', ', ' );
    181                 if ( $tags_list ) :
     181                $tags_list = get_the_tag_list( '', ', ' );
     182                if ( $tags_list && ! is_wp_error( $tags_list ) ) :
    182183                    ?>
    183184                <span class="tag-links">
     
    189190                <span class="meta-sep">|</span>
    190191                <?php endif; ?>
     192
    191193                <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
     194
    192195                <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    193196            </div><!-- .entry-utility -->
Note: See TracChangeset for help on using the changeset viewer.