Make WordPress Core

Opened 2 years ago

Closed 21 months ago

Last modified 21 months ago

#48347 closed defect (bug) (fixed)

WP_Customize_Setting::__construct() is missing `$args` documentation

Reported by: marekdedic Owned by: SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: minor Version: 5.2
Component: Customize Keywords: good-first-bug has-patch
Focuses: docs Cc:


Documentation for the fields of the $args argument is missing:


I believe a good starting point would be the documentation of WP_Customize_Manager::add_setting():


Although I am not sure about the correctness of what's in there. But from the implementation of add_panel, I'd say they should match.

As per https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays, there should only be a @see comment in add_setting and the documentation should be in the constructor I believe.

Attachments (1)

48347.diff (4.4 KB) - added by tmanoilov 2 years ago.

Download all attachments as: .zip

Change History (10)

#1 @marekdedic
2 years ago

Also, I believe the type of theme_supports could be narrowed from string|array to string|string[] ;)

Last edited 2 years ago by marekdedic (previous) (diff)

#2 @johnbillion
2 years ago

  • Keywords needs-patch good-first-bug added

#3 @desrosj
2 years ago

  • Milestone changed from Awaiting Review to 5.4

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

2 years ago

2 years ago

#5 @tmanoilov
2 years ago

  • Keywords has-patch added; needs-patch removed

Hello, I'm a first time contributor so please review and let me know if anything else needs to be done.

#6 @SergeyBiryukov
2 years ago

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

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

21 months ago

#8 @SergeyBiryukov
21 months ago

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

In 47384:

Docs: Add a reference to WP_Customize_Setting::__construct() for information on accepted arguments in WP_Customize_Manager::add_setting().

Synchronize the documentation between two places, use WP_Customize_Setting::__construct() as the canonical source.

Props tmanoilov, marekdedic.
Fixes #48347.

#9 @SergeyBiryukov
21 months ago

In 47385:

Docs: Clarify the type of theme_supports argument in various Customizer classes.

Props marekdedic.
See #48347.

Note: See TracTickets for help on using tickets.