- This topic has 22 replies, 4 voices, and was last updated 3 years, 10 months ago by
David.
-
AuthorPosts
-
October 7, 2021 at 5:37 am #1955748
Jesse
Hi David,
I figured it out. First, the reply button worked normally when Yoast was the only plugin I disabled. This is why I thought the issue was with Yoast alone.
I did some additional testing, and as it turns out, the reply button worked normally when Yoast was ENABLED but only if the Code Snippets plugin was DISABLED. This meant one of my snippets was conflicting with Yoast.
So I started turning off my snippets one at a time, and I narrowed it down to this filter:
add_filter( 'cancel_comment_reply_link', '__return_false' );
I can leave all plugins turned on as normal. When I turn off this one single filter, my reply button works normally again. The above filter is discussed here: https://generatepress.com/forums/topic/h3-comment-reply-title/
It fixed an issue where the H3 within the HTML would appear as “Leave a Comment Cancel reply” instead of just “Leave a Comment” which I wanted to clean up for accessibility purposes.
So now my reply button works normally again, but my H3 is back to “Leave a Comment Cancel reply” which bugs me. Any ideas?
Best regards,
JesseOctober 7, 2021 at 7:20 am #1955836David
StaffCustomer SupportAh good find… not sure why removing that would break the reply link. I would suggest opening a topic with Yoast support to see if they have any ideas.
October 24, 2021 at 5:42 am #1973409Jesse
Hi David,
Yoast provided a video of their test environment where they added this filter:
add_filter( 'cancel_comment_reply_link', '__return_false' );
And the comment reply button worked normally. I did some more testing today and as soon as I turn this filter on, it breaks the comment reply button.
Do you have any other thoughts? Yoast suggested that maybe the “cancel reply” text could be removed within the child theme.
Best regards,
JesseOctober 24, 2021 at 7:16 am #1973457David
StaffCustomer SupportThe Comment Reply form is only output once in the WP comments-form.php template. When you reply to an existing comment it uses Javascript to move the form and rewrite the reply link etc. So there is no way to remove it without it affecting ALL replies.
Instead of disabling the cancel reply link you could try simply returning an empty space in its place:
add_filter( 'cancel_comment_reply_link', function() { return ' '; } );
October 24, 2021 at 7:20 am #1973461Jesse
Thanks, David. Great idea, but unfortunately that filter creates the same behavior. The standard reply button stops working when I enable it.
October 24, 2021 at 8:06 am #1973731David
StaffCustomer SupportRunning out of options here… but i did find this clever snippet:
https://seobro.de/wordpress-kommentare-link-bearbeiten-abbrechen/
It removes the default comment reply cancel link and hooks a replacement link in below the comments form.
October 24, 2021 at 9:04 am #1973756Jesse
Hi David,
I like that one, thanks!
October 24, 2021 at 9:21 am #1973767David
StaffCustomer SupportAwesome – glad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.