Site logo

[Resolved] H3 Comment Reply Title

Home Forums Support [Resolved] H3 Comment Reply Title

Home Forums Support H3 Comment Reply Title

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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,
    Jesse

    #1806581
    Elvin
    Staff
    Customer Support

    Hi 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/

    #1806584
    Jesse

    Hello Elvin,

    By adding that filter, is it disabling any sort of functionality? What is that filter doing exactly?

    Best regards,
    Jesse

    #1806625
    Elvin
    Staff
    Customer Support

    By adding that filter, is it disabling any sort of functionality? What is that filter doing exactly?

    It removes the Cancel Reply link added within the comment label H3 tag.

    #1806628
    Jesse

    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,
    Jesse

    #1806640
    Elvin
    Staff
    Customer Support

    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?

    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.

    #1806643
    Jesse

    Thanks, Elvin. The filter seems to work perfectly!

    #1806645
    Elvin
    Staff
    Customer Support

    No problem. Glad to be of any help. 😀

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.