get_comment_link( WP_Comment|int|null $comment = null, array $args = array() ): string

Retrieves the link to a given comment.


Description

Top ↑

See also


Top ↑

Parameters

$comment WP_Comment|int|null Optional
Comment to retrieve. Default current comment.

Default: null

$args array Optional
An array of optional arguments to override the defaults.
  • type string
  • page int
    Current page of comments, for calculating comment pagination.
  • per_page int
    Per-page value for comment pagination.
  • max_depth int
  • cpage int|string
    Value to use for the comment's "comment-page" or "cpage" value.
    If provided, this value overrides any value calculated from $page and $per_page.
More Arguments from get_page_of_comment( ... $args ) Array of optional arguments.
  • type string
    Limit paginated comments to those matching a given type.
    Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'.
  • per_page int
    Per-page count to use when calculating pagination.
    Defaults to the value of the 'comments_per_page' option.
  • max_depth int|string
    If greater than 1, comment page will be determined for the top-level parent $comment_id.
    Defaults to the value of the 'thread_comments_depth' option.