From 5ae85ca5fa378443b21f22f47abd23c2dc649d37 Mon Sep 17 00:00:00 2001 From: koenemann Date: Tue, 7 Feb 2017 15:23:13 +0100 Subject: [PATCH] update template-tags --- inc/template-tags.php | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index df23979..63eadf2 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -14,28 +14,23 @@ if ( ! function_exists( 'understrap_posted_on' ) ) : function understrap_posted_on() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = ', '; + $time_string = ''; } - $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); - $posted_on = sprintf( esc_html_x( 'Posted on %s', 'post date', 'understrap' ), '' . $time_string . '' ); - $byline = sprintf( esc_html_x( 'by %s', 'post author', 'understrap' ), '' . esc_html( get_the_author() ) . '' ); - - echo '' . $posted_on . ' ' . $byline . ''; - + echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK. } endif; @@ -45,27 +40,24 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) : */ function understrap_entry_footer() { // Hide category and tag text for pages. - if ( 'post' == get_post_type() ) { + if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ - $categories_list = get_the_category_list( __( ', ', 'understrap' ) ); + $categories_list = get_the_category_list( esc_html__( ', ', 'understrap' ) ); if ( $categories_list && understrap_categorized_blog() ) { - printf( '' . __( 'Posted in %1$s', 'understrap' ) . '', $categories_list ); + printf( '' . esc_html__( 'Posted in %1$s', 'understrap' ) . '', $categories_list ); // WPCS: XSS OK. } - /* translators: used between list items, there is a space after the comma */ - $tags_list = get_the_tag_list( '', __( ', ', 'understrap' ) ); + $tags_list = get_the_tag_list( '', esc_html__( ', ', 'understrap' ) ); if ( $tags_list ) { - printf( '' . __( 'Tagged %1$s', 'understrap' ) . '', $tags_list ); + printf( '' . esc_html__( 'Tagged %1$s', 'understrap' ) . '', $tags_list ); // WPCS: XSS OK. } } - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; - comments_popup_link( __( 'Leave a comment', 'understrap' ), __( '1 Comment', 'understrap' ), __( '% Comments', 'understrap' ) ); + comments_popup_link( esc_html__( 'Leave a comment', 'understrap' ), esc_html__( '1 Comment', 'understrap' ), esc_html__( '% Comments', 'understrap' ) ); echo ''; } - - edit_post_link( + edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'understrap' ),