From a14b802e750e210257a64b7adc3ee98b1f5e6efc Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Wed, 10 Sep 2014 17:41:19 -0700 Subject: [PATCH] _s: Move edit link in template tag for consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- content-search.php | 1 - content-single.php | 1 - content.php | 1 - inc/template-tags.php | 58 ++++++++++++++++++++++--------------------- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/content-search.php b/content-search.php index 9786ba35..a045902b 100644 --- a/content-search.php +++ b/content-search.php @@ -25,6 +25,5 @@ diff --git a/content-single.php b/content-single.php index 130db9a5..0e13374e 100644 --- a/content-single.php +++ b/content-single.php @@ -25,6 +25,5 @@ diff --git a/content.php b/content.php index 9efa5cb8..dd14136a 100644 --- a/content.php +++ b/content.php @@ -27,6 +27,5 @@ diff --git a/inc/template-tags.php b/inc/template-tags.php index 7a846af1..7dd638d8 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -93,6 +93,36 @@ function _s_posted_on() { } 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( '' . __( 'Posted in %1$s', '_s' ) . '', $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( '' . __( 'Tagged %1$s', '_s' ) . '', $tags_list ); + } + } + + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); + echo ''; + } + + edit_post_link( __( 'Edit', '_s' ), '', '' ); +} +endif; + /** * 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( '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( '' . __( 'Posted in %1$s', '_s' ) . '', $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( '' . __( 'Tagged %1$s', '_s' ) . '', $tags_list ); - } - } - - if ( ! is_single() && ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) { - echo ''; - comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); - echo ''; - } -} -endif;