From e39d6e611498b15acf11f53b533513c8cecb5519 Mon Sep 17 00:00:00 2001 From: Raam Dev Date: Tue, 5 Jan 2021 17:23:43 -0500 Subject: [PATCH 1/2] Fixes bug where webmentions were hidden when comments are disabled. Adds template tag `independent_publisher_hide_mentions()`. See https://github.com/raamdev/independent-publisher/issues/319 --- comments.php | 2 +- content.php | 2 +- inc/template-tags.php | 9 +++++++++ page.php | 6 +++--- single.php | 7 +++++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/comments.php b/comments.php index 46c306c..61fd064 100755 --- a/comments.php +++ b/comments.php @@ -95,7 +95,7 @@
- +

diff --git a/content.php b/content.php index b4074ae..f144e33 100755 --- a/content.php +++ b/content.php @@ -113,7 +113,7 @@ - + 1 ? __( 'Webmentions', 'independent-publisher' ) : __( 'Webmention', 'independent-publisher' ) ); ?> diff --git a/inc/template-tags.php b/inc/template-tags.php index b0f96d8..87500f6 100755 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -793,6 +793,15 @@ function independent_publisher_hide_comments() { } endif; +if ( !function_exists( 'independent_publisher_hide_mentions' ) ): + /** + * Determines if webmentions should be hidden altogether. + */ + function independent_publisher_hide_mentions() { + return false; + } +endif; + if ( !function_exists( 'independent_publisher_footer_credits' ) ): /** * Echoes the theme footer credits. Overriding this function in a Child Theme also diff --git a/page.php b/page.php index 0d2e1e9..572263d 100755 --- a/page.php +++ b/page.php @@ -21,10 +21,10 @@ 0 && !independent_publisher_hide_mentions() ) ) { comments_template( '', true ); - endif; + } ?> diff --git a/single.php b/single.php index a4d7af2..6754eee 100755 --- a/single.php +++ b/single.php @@ -16,8 +16,11 @@ 0 && !independent_publisher_hide_mentions() ) ) { comments_template( '', true ); } ?> From 8519044f8fc8911e38d614ed9e6f7e532d911b48 Mon Sep 17 00:00:00 2001 From: Raam Dev Date: Tue, 5 Jan 2021 17:26:51 -0500 Subject: [PATCH 2/2] Update code documentation --- page.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/page.php b/page.php index 572263d..05e2d8f 100755 --- a/page.php +++ b/page.php @@ -21,6 +21,9 @@ 0 && !independent_publisher_hide_mentions() ) ) { comments_template( '', true );