Skip to content

Commit

Permalink
Hide meta post author filter
Browse files Browse the repository at this point in the history
  • Loading branch information
crftwrk committed Apr 16, 2024
1 parent d9d5d0b commit d662b2b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
'<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>'
Expand All @@ -113,7 +120,7 @@ function bootscore_author() {
echo '<span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.

}
endif;
}


/**
Expand Down

0 comments on commit d662b2b

Please sign in to comment.