_s: Move edit link in template tag for consistency

Every time `_s_entry_footer()` is used, it’s followed by
`edit_post_link()`. Might as well just move that back in the template
tag.
This commit is contained in:
Konstantin Obenland 2014-09-10 17:41:19 -07:00
parent 2990f8260c
commit a14b802e75
4 changed files with 30 additions and 31 deletions

View File

@ -25,6 +25,5 @@
<footer class="entry-footer"> <footer class="entry-footer">
<?php _s_entry_footer(); ?> <?php _s_entry_footer(); ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -25,6 +25,5 @@
<footer class="entry-footer"> <footer class="entry-footer">
<?php _s_entry_footer(); ?> <?php _s_entry_footer(); ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -27,6 +27,5 @@
<footer class="entry-footer"> <footer class="entry-footer">
<?php _s_entry_footer(); ?> <?php _s_entry_footer(); ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -93,6 +93,36 @@ function _s_posted_on() {
} }
endif; endif;
if ( ! function_exists( '_s_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function _s_entry_footer() {
// Hide category and tag text for pages.
if ( 'post' == get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) {
printf( '<span class="cat-links">' . __( 'Posted in %1$s', '_s' ) . '</span>', $categories_list );
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) {
printf( '<span class="tags-links">' . __( 'Tagged %1$s', '_s' ) . '</span>', $tags_list );
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) );
echo '</span>';
}
edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' );
}
endif;
/** /**
* Returns true if a blog has more than 1 category. * Returns true if a blog has more than 1 category.
* *
@ -133,31 +163,3 @@ function _s_category_transient_flusher() {
} }
add_action( 'edit_category', '_s_category_transient_flusher' ); add_action( 'edit_category', '_s_category_transient_flusher' );
add_action( 'save_post', '_s_category_transient_flusher' ); add_action( 'save_post', '_s_category_transient_flusher' );
if ( ! function_exists( '_s_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function _s_entry_footer() {
/* Hide category and tag text for pages */
if ( 'post' == get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) {
printf( '<span class="cat-links">' . __( 'Posted in %1$s', '_s' ) . '</span>', $categories_list );
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) {
printf( '<span class="tags-links">' . __( 'Tagged %1$s', '_s' ) . '</span>', $tags_list );
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) );
echo '</span>';
}
}
endif;