- This topic has 7 replies, 2 voices, and was last updated 4 years, 10 months ago by
Elvin.
-
AuthorPosts
-
June 1, 2021 at 7:55 am #1806106
Jesse
Hello,
Visually, I can only see “Leave a Comment” on my screen. However, when I check the source code, the H3 for that “Leave a Comment” heading is actually “Leave a Comment Cancel reply” – how can I fix this so that the H3 is only “Leave a Comment”? The “Cancel reply” part should be removed from that H3.
Best regards,
JesseJune 1, 2021 at 4:31 pm #1806581Elvin
StaffCustomer SupportHi Jesse,
That one you see is this: https://share.getcloudapp.com/d5uA4qlL
It’s a WordPress default. All themes have it.
But to help you out:
Try this PHP filter –
add_filter( 'cancel_comment_reply_link', '__return_false' );Here’s how to add PHP snippets to your site – https://docs.generatepress.com/article/adding-php/
June 1, 2021 at 4:38 pm #1806584Jesse
Hello Elvin,
By adding that filter, is it disabling any sort of functionality? What is that filter doing exactly?
Best regards,
JesseJune 1, 2021 at 6:05 pm #1806625Elvin
StaffCustomer SupportBy adding that filter, is it disabling any sort of functionality? What is that filter doing exactly?
It removes the
Cancel Replylink added within the comment label H3 tag.June 1, 2021 at 6:10 pm #1806628Jesse
Where does that “Cancel reply” link come from? By using this filter, will someone no longer be able to cancel their reply? Or will that functionality still be there?
Best regards,
JesseJune 1, 2021 at 6:34 pm #1806640Elvin
StaffCustomer SupportWhere does that “Cancel reply” link come from? By using this filter, will someone no longer be able to cancel their reply? Or will that functionality still be there?
As previously mentioned. It’s WordPress default. Even the default themes have it. https://github.com/WordPress/WordPress/blob/270f2011f8ec7265c3f4ddce39c77ef5b496ed1c/wp-includes/comment-template.php#L1898
By using this filter, will someone no longer be able to cancel their reply? Or will that functionality still be there?
To be honest, I’m not even sure why WordPress keeps it. It’s set to “display: none;” by default so basically, it’s not even showing on the site for interactive purposes.
And users can always simply refresh the page if they don’t wish to push through with the comment, this effective “cancels” the reply.
June 1, 2021 at 6:43 pm #1806643Jesse
Thanks, Elvin. The filter seems to work perfectly!
June 1, 2021 at 6:47 pm #1806645Elvin
StaffCustomer SupportNo problem. Glad to be of any help. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.