From 5e62b8dc9edc13473a3d6cdcf423542d30346f1e Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Mon, 24 Mar 2014 00:08:21 +0100 Subject: [PATCH 1/2] Remove html from string --- inc/template-tags.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index c852eb79..71518aeb 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -82,7 +82,8 @@ function _s_posted_on() { esc_html( get_the_modified_date() ) ); - printf( __( 'Posted on %1$s by %2$s', '_s' ), + printf( + '' . __( 'Posted on %1$s', '_s' ) . ' ' . __( 'by %2$s', '_s' ) . '', sprintf( '%2$s', esc_url( get_permalink() ), $time_string From fc9910cf96685cd65214a8628f51e54c7696bc12 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Thu, 1 May 2014 23:27:08 +0200 Subject: [PATCH 2/2] Split strings into variables --- inc/template-tags.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 71518aeb..f4abb75f 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -82,17 +82,18 @@ function _s_posted_on() { esc_html( get_the_modified_date() ) ); - printf( - '' . __( 'Posted on %1$s', '_s' ) . '', - sprintf( '%2$s', - esc_url( get_permalink() ), - $time_string - ), - sprintf( '%2$s', - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - esc_html( get_the_author() ) - ) + $posted_on = sprintf( + _x( 'Posted on %s', 'post date', '_s' ), + '' . $time_string . '' ); + + $byline = sprintf( + _x( 'by %s', 'post author', '_s' ), + '' . esc_html( get_the_author() ) . '' + ); + + echo '' . $posted_on . ''; + } endif;