From d7309b1fbeca70c0e27c4aa23cc3c21ff5cde288 Mon Sep 17 00:00:00 2001 From: Aron Ambrosiani Date: Thu, 15 Oct 2020 20:48:06 +0200 Subject: [PATCH 1/2] Update single-functions.php --- src/functions/single-functions.php | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php index f6cc392..5d507dd 100644 --- a/src/functions/single-functions.php +++ b/src/functions/single-functions.php @@ -96,26 +96,29 @@ endif; /** * Display date of post. */ -function tainacan_meta_date_author( $echo = true ) { - $time = ''; +if ( function_exists('tainacan_meta_date_author') ) { + function tainacan_meta_date_author( $echo = true ) { + $time = ''; - $time_string = sprintf( $time, - esc_attr( get_the_date( 'c' ) ), - get_the_date() - ); + $time_string = sprintf( $time, + esc_attr( get_the_date( 'c' ) ), + get_the_date() + ); - $string = $time_string; - $string .= __( ' by ', 'tainacan-interface' ); - $string .= get_the_author_posts_link(); + $string = $time_string; + $string .= __( ' by ', 'tainacan-interface' ); + $string .= get_the_author_posts_link(); - $string = apply_filters( 'tainacan-meta-date-author', $string ); + $string = apply_filters( 'tainacan-meta-date-author', $string ); - if ( $echo ) { - echo $string; - } else { - return $string; + if ( $echo ) { + echo $string; + } else { + return $string; + } } } +endif; // define the cancel_comment_reply_link callback function tainacan_filter_cancel_comment_reply_link( $formatted_link, $link, $text ) { From 78a1df658430f47427949dee86bd3cfc889a31ed Mon Sep 17 00:00:00 2001 From: Aron Ambrosiani Date: Thu, 15 Oct 2020 20:53:18 +0200 Subject: [PATCH 2/2] Update single-functions.php --- src/functions/single-functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php index 5d507dd..92e7909 100644 --- a/src/functions/single-functions.php +++ b/src/functions/single-functions.php @@ -96,7 +96,7 @@ endif; /** * Display date of post. */ -if ( function_exists('tainacan_meta_date_author') ) { +if ( ! function_exists('tainacan_meta_date_author') ) { function tainacan_meta_date_author( $echo = true ) { $time = ''; @@ -118,7 +118,6 @@ if ( function_exists('tainacan_meta_date_author') ) { } } } -endif; // define the cancel_comment_reply_link callback function tainacan_filter_cancel_comment_reply_link( $formatted_link, $link, $text ) {