Make WordPress Core

Changeset 23793

Timestamp:
03/22/2013 10:56:55 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Ten: change gallery category post meta output to check for a "gallery" category using get_term_by() to avoid a possible WP_Error for an empty result by getting a false (boolean) return value instead.

And, change link output to use get_category_link() instead of get_term_link().

Props SergeyBiryukov and keoshi, fixes #23837.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/loop.php

    r22197 r23793  
    9393                <a href="<?php echo get_post_format_link( 'gallery' ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
    9494                <span class="meta-sep">|</span>
    95             <?php elseif ( in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
    96                 <a href="<?php echo get_term_link( _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
     95            <?php elseif ( ) ) : ?>
     96                <a href="<?php echo get_ ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
    9797                <span class="meta-sep">|</span>
    9898            <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.