WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#35908 closed defect (bug) (fixed)

Documentation of `pre_comment_content` declares wrong variable type information

Reported by: meitar Owned by: boonebgorges
Milestone: 4.5 Priority: normal
Severity: minor Version: 3.8
Component: Comments Keywords: has-patch
Focuses: docs Cc:

Description

Super simple, but I just noticed that the documentation for the pre_comment_content filter says the filter returns an int when in fact it returns a string.

Trivial patch attached.

Attachments (2)

35908.diff (469 bytes) - added by meitar 21 months ago.
Correct type information for filter hook return value.
35908.2.diff (1.2 KB) - added by meitar 21 months ago.
Correct variable type information for additional two neighboring filters.

Download all attachments as: .zip

Change History (6)

@meitar
21 months ago

Correct type information for filter hook return value.

#1 follow-up: @netweb
21 months ago

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

@meitar Thanks for the patch, could you update it to include the two filters above and below pre_comment_content

That is in that same wp_filter_comment() function both the filters pre_comment_user_agent and pre_comment_user_ip below should also both be string

@meitar
21 months ago

Correct variable type information for additional two neighboring filters.

#2 in reply to: ↑ 1 @meitar
21 months ago

  • Keywords has-patch added; needs-patch removed

:) LOL, tunnel vision. I didn't event notice those because tunnel vision on this project, I don't need those fields. But yes, I added a new patch. Thanks for catching those.

#3 @boonebgorges
21 months ago

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

In 36626:

Docs: Correct param types on some filters in wp_filter_comment().

Introduced in [26491].

Props meitar, netweb.
Fixes #35908.

#4 @johnbillion
21 months ago

  • Version changed from trunk to 3.8
Note: See TracTickets for help on using tickets.