mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 01:52:24 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@23793 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
309fb3d7f5
commit
e9746944fa
@ -92,8 +92,8 @@
|
||||
<?php if ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) : ?>
|
||||
<a href="<?php echo get_post_format_link( 'gallery' ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
|
||||
<span class="meta-sep">|</span>
|
||||
<?php elseif ( in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
|
||||
<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>
|
||||
<?php elseif ( $gallery = get_term_by( 'slug', _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' ) && in_category( $gallery->term_id ) ) : ?>
|
||||
<a href="<?php echo get_category_link( $gallery ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
|
||||
<span class="meta-sep">|</span>
|
||||
<?php endif; ?>
|
||||
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user