Make WordPress Core

#44850 closed defect (bug) (fixed)

incorrect DocBlock for set-screen-option filter

Reported by: pbiron Owned by: SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-patch
Focuses: docs Cc:


This is a follow-up to #26186.

The first param in the DocBLock in the patch committed in r27379 is incorrect, in a couple of ways:

  1. the param type should be bool
  2. the param name should be something like $keep (see below)
  3. the param description should be something like Whether to keep or skip saving the screen option value. Default false.

The fact that the incorrect name $value is also the name of another one of the params causes phpdoc-parser to skip outputting the param altogether in the Code Reference: https://developer.wordpress.org/reference/hooks/set-screen-option/ (caused me a few minutes of grief wondering why my screen options weren't being saved).

Related: #42505

Attachments (1)

44850.patch (747 bytes) - added by burhandodhy 21 months ago.
As par pbiron recommendation

Download all attachments as: .zip

Change History (8)

#1 @pbiron
21 months ago

  • Summary changed from correct DocBlock for set-screen-option filter to incorrect DocBlock for set-screen-option filter

#2 @SergeyBiryukov
21 months ago

  • Component changed from General to Administration
  • Keywords good-first-bug added

21 months ago

As par pbiron recommendation

#3 @isharis
21 months ago

  • Keywords has-patch added; needs-patch removed

#4 @pento
20 months ago

  • Milestone changed from 5.0 to 5.1

This ticket was mentioned in Slack in #core by sergey. View the logs.

18 months ago

#6 @SergeyBiryukov
18 months ago

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

#7 @SergeyBiryukov
16 months ago

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

In 44667:

Docs: Correct type and description for the first parameter of set-screen-option filter.

Props pbiron, burhandodhy.
Fixes #44850.

Note: See TracTickets for help on using tickets.