How can get comment id from comment link?

Let’s say that this is the comment link:

http://localhost/post/test/#comment-86

I want to do this thing:

Check if current page URL requesting a comment or not (have #comment-x or not).

If current page URL is requesting a comment get the comment id from the URL.

Read more here:: How can get comment id from comment link?

Leave a Reply

Your email address will not be published. Required fields are marked *