WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 7 months ago

#37955 closed enhancement (fixed)

Make it possible to whitelist URLs in check_comment()

Reported by: ocean90 Owned by: rachelbaker
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch commit
Focuses: Cc:

Description

Use case: #meta1776

There is currently no way to exclude URLs for the number of external links check.

One option might be to pass $comment to the comment_max_links_url filter. This would make it possible to re-check the comment and reduce $num_links.

Attachments (1)

37955.diff (803 bytes) - added by rachelbaker 7 months ago.
Adds the $comment parameter to the comment_max_links_url filter

Download all attachments as: .zip

Change History (5)

@rachelbaker
7 months ago

Adds the $comment parameter to the comment_max_links_url filter

#1 @rachelbaker
7 months ago

  • Keywords has-patch commit added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.7

#2 @rachelbaker
7 months ago

In 37955.diff I added the $comment parameter to the comment_max_links filter. This allows the comment_content to be included in hooked functions.

@ocean90 This was the best option I could see to solve for your provided (and likely somewhat common) use-case.

#3 @rachelbaker
7 months ago

  • Owner set to rachelbaker
  • Status changed from new to accepted

#4 @ocean90
7 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 38748:

Comments: Pass $comment to the comment_max_links_url filter.

Props rachelbaker.
Fixes #37955.

Note: See TracTickets for help on using tickets.