Make WordPress Core

Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#60214 closed defect (bug) (fixed)

Fix var types of parameters in `sanitize_option_{$option}` filter

Reported by: crstauf's profile crstauf Owned by: audrasjb's profile audrasjb
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: docs Cc:

Description

The documentation is defining $value and $original_value as if they were of type string, but they are very often of type array.

Reported by @gerardreches via User Contributed Notes.

Change History (7)

This ticket was mentioned in PR #5848 on WordPress/wordpress-develop by @crstauf.


9 months ago
#1

  • Keywords has-patch added

Fixes the documentation of the parameters used in sanitize_option_{$option} filter.

Reported by gerardreches via User Contributed Notes.

Trac ticket: https://core.trac.wordpress.org/ticket/60214

#2 @audrasjb
9 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Thanks for the ticket! Self assigning for review.

#3 @audrasjb
9 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.5
  • Status changed from reviewing to accepted

Using mixed looks good to me since the value can be anything: worth not listing all possible types here.
Moving for 6.5 consideration.

@mukesh27 commented on PR #5848:


9 months ago
#4

@crstauf left one minor question for clarification. Thanks!

@crstauf commented on PR #5848:


9 months ago
#5

left one minor question for clarification. Thanks!

@mukeshpanchal27 Done. Thanks.

#6 @audrasjb
9 months ago

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

In 57302:

Docs: Fix var types of parameters in sanitize_option() and sanitize_option_{$option}.

The related docblocks were previously defining $value and $original_value as if they were of type string, but they can also be of other types, like array.

Props gerardreches, crstauf, mukesh27.
Fixes #60214.
See #59651.

Note: See TracTickets for help on using tickets.