Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60214 closed defect (bug) (fixed)

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

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

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.


3 years 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
3 years ago

  • Owner set to audrasjb
  • Status new → reviewing

Thanks for the ticket! Self assigning for review.

#3 @audrasjb
3 years ago

  • Keywords commit added
  • Milestone Awaiting Review → 6.5
  • Status reviewing → 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:


3 years ago
#4

@crstauf left one minor question for clarification. Thanks!

​@crstauf commented on ​PR #5848:


3 years ago
#5

left one minor question for clarification. Thanks!

@mukeshpanchal27 Done. Thanks.

#6 @audrasjb
3 years ago

  • Resolution → fixed
  • Status accepted → 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.