From 2d74ebd7c9573d1517733395a7c2d22d3cfd3aa6 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 29 Oct 2017 15:31:22 +0000 Subject: [PATCH 1/2] Split _s_posted_on into two functions --- inc/template-tags.php | 14 ++++++++++++-- template-parts/content-search.php | 5 ++++- template-parts/content.php | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 3260c44e..880c1e31 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -9,7 +9,7 @@ if ( ! function_exists( '_s_posted_on' ) ) : /** - * Prints HTML with meta information for the current post-date/time and author. + * Prints HTML with meta information for the current post-date/time. */ function _s_posted_on() { $time_string = ''; @@ -30,13 +30,23 @@ if ( ! function_exists( '_s_posted_on' ) ) : '' . $time_string . '' ); + echo '' . $posted_on . ''; // WPCS: XSS OK. + + } +endif; + +if ( ! function_exists( '_s_posted_by' ) ) : + /** + * Prints HTML with meta information for the current author. + */ + function _s_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', '_s' ), '' . esc_html( get_the_author() ) . '' ); - echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK. + echo ' ' . $byline . ''; // WPCS: XSS OK. } endif; diff --git a/template-parts/content-search.php b/template-parts/content-search.php index b7ac2ff9..97136de9 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -15,7 +15,10 @@
- +
diff --git a/template-parts/content.php b/template-parts/content.php index 6e3b38f0..f8718862 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -20,7 +20,10 @@ if ( 'post' === get_post_type() ) : ?>
- +
From f99c9b5bd0aeedbec46d3b1991814b1107fac2eb Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 29 Oct 2017 21:30:50 +0000 Subject: [PATCH 2/2] Fix the indentation of the PHP tags --- template-parts/content-search.php | 4 ++-- template-parts/content.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/template-parts/content-search.php b/template-parts/content-search.php index 97136de9..37bc0971 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -16,8 +16,8 @@ diff --git a/template-parts/content.php b/template-parts/content.php index f8718862..2b885925 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -21,8 +21,8 @@ if ( 'post' === get_post_type() ) : ?>