Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#28314 new defect (bug)

cancel_comment_reply_link() is unflexible - respond_id & post check

Reported by: ninos-ego's profile Ninos Ego Owned by:
Milestone: Priority: normal
Severity: major Version: 3.9.1
Component: Comments Keywords: has-patch needs-refresh
Focuses: template Cc:

Description

There are two found problems with the function

cancel_comment_reply_link()
  1. You cannot define a custom respond id like #respond-POSTID. The respond id (#respond) is hardcoded. So the anchor is not working anymore, if you use a custom respond_id in your theme.
  2. If you include the comments on the blogs page (loop) you have comment areas as much as posts. Now you answer to a comment of a specific comment (for example: http://example.com/blog/?replytocom=210#respond-821). This is working fine, just that the cancel_comment_reply_link() is going active for all posts and shows a cancel message under each comment area. It should check for the specific comment area/post and return the message just for the affected comment area/post.

If you want I can create a patch for this two bugs :-)

Best regards,
Ninos

Attachments (2)

cancel_comment_reply_link.diff (2.2 KB) - added by Ninos Ego 10 years ago.
Patch 1.0 - cancel_comment_reply_link()
comment-template.php.patch (2.6 KB) - added by Ninos Ego 10 years ago.

Download all attachments as: .zip

Change History (8)

@Ninos Ego
10 years ago

Patch 1.0 - cancel_comment_reply_link()

#1 @Ninos Ego
10 years ago

  • Focuses template added
  • Keywords has-patch added
  • Severity changed from normal to major

#2 @Ninos Ego
10 years ago

  • Keywords dev-feedback added

Are there any news about this ticket/patch? It's more than 9 months old and I did not get any feedback..

This ticket was mentioned in Slack in #core-comments by rachelbaker. View the logs.


8 years ago

#6 @rachelbaker
8 years ago

  • Keywords needs-refresh added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

comment-template.php.patch Needs a refreshed patch that also adheres to our code style and documentation standards.

I suggest adding $comment = null as the second argument to the cancel_comment_reply_link() and get_cancel_comment_reply_link() functions so they can accept a WP_Comment object. The cancel_comment_reply_link filter should be updated to include the parameter as well. This approach wouldn't require changing the current function argument.


Note: See TracTickets for help on using tickets.