Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28373 closed enhancement (fixed)

edit_comment_link filter should pass the anchor text as a variable

Reported by: kwight's profile kwight Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Comments Keywords: has-patch commit
Focuses: Cc:

Description

The edit_comment_link filter currently passes only the comment ID as a variable. If a developer wants to assemble their own markup for the edit comment link, they'll need to somehow parse the anchor text from the entire $link variable. Passing the anchor text as a variable will solve this.

Attachments (3)

28373.diff (1.4 KB) - added by kwight 10 years ago.
28373.2.diff (1.5 KB) - added by kwight 10 years ago.
28373.3.diff (2.9 KB) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (6)

@kwight
10 years ago

@kwight
10 years ago

#1 follow-up: @kwight
10 years ago

28373.2.diff can take it a step further and pass in the $before and $after variables, bringing the edit_comment_link filter more in line with the comment_reply_link filter.

#2 in reply to: ↑ 1 @SergeyBiryukov
10 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.0

28373.3.diff does the same for edit_post_link() and also updates filter docs.

Replying to kwight:

28373.2.diff can take it a step further and pass in the $before and $after variables, bringing the edit_comment_link filter more in line with the comment_reply_link filter.

That would make it less in line with edit_post_link filter :)

#3 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 28590:

Pass anchor text to 'edit_post_link' and 'edit_comment_link' filters.

props kwight.
fixes #28373.

Note: See TracTickets for help on using tickets.