Opened 16 years ago
Closed 16 years ago
#8287 closed enhancement (fixed)
More get_comment_link() improvements
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
- Don't force theme authors to pass the page argument value to
get_comment_link()
in their comment walker. We can just do it ourselves behind the scenes. This simplifies things a lot.
- Replace
get_comment_link()
's second parameter with an$args
allowing you to pass things liketype
(it's backwards compatible). Basically if you know you're going to be passing atype
towp_list_comments()
(for examplecomment
) and need to useget_comment_link()
outside of the loop (i.e. a custom recent comments), pass the sametype
toget_comment_link()
and you should end up with a proper page number. Note the default recent comments widget will still produce the wrong page numbers if you pass atype
towp_list_comments()
.
- Change number 2 required updating
get_page_of_comment()
to support all these extra args.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
If any plugin to theme authors were directly using
get_page_of_comment()
already (dunno why they would as it's mainly an internal function), then this patch may break their code due to the changed parameters.That's unlikely though and 2.7 hasn't gone gold yet though so I figured it wasn't worth having backwards compatibility on an internal, new function.
get_comments_link()
is however used by theme authors so it's new parameters are backwards compatible.