The function can be found here, by default only the $text can be edited:

<?php cancel_comment_reply_link( $text ); ?>

And the default output like below:

<a rel="nofollow" id="cancel-comment-reply-link" href="/wp/template-sticky/#respond">Cancel reply</a>

Can I add class="cancel-reply" to the link?

<a rel="nofollow" class="cancel-reply" id="cancel-comment-reply-link" href="/wp/template-sticky/#respond">Cancel reply</a>
                  ^^^^^^^^^^^^^^^^^^^^

Read more here: Add a class to cancel_comment_reply_link()


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: