diff --git a/inc/template-tags.php b/inc/template-tags.php index 2354285f..85ceba7f 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -102,9 +102,16 @@ function bootscore_date() { /** * Author */ -if (!function_exists('bootscore_author')) : +if (!function_exists('bootscore_author')) { function bootscore_author() { + $display_author = apply_filters('bootscore/author', true); + + // Check if the filter returns false, if so, return early without displaying the author + if (!$display_author) { + return; + } + $byline = sprintf( esc_html_x('by %s', 'post author', 'bootscore'), '' . esc_html(get_the_author()) . '' @@ -113,7 +120,7 @@ function bootscore_author() { echo ' ' . $byline . ''; // WPCS: XSS OK. } -endif; +} /**