Make WordPress Core

Opened 4 years ago

Closed 16 months ago

#42786 closed defect (bug) (fixed)

get_settings_errors() inline docs return should reflect the array in detail

Reported by: webdevmattcrom Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Options, Meta APIs Keywords: has-patch
Focuses: docs Cc:


The return array should be explained in better detail in the inline docs, both for the purpose of clarity for developers, and for DevHub purposes.

Here's the line in the code:

Suggested return array:

@return array {
 *     @type string $setting    The setting that is throwing an error.
 *     @type string $code       Code of the error.
 *     @type string $message    Message of the error.
 *     @type string $type       Type of error.
 * }

I have a patch, but would like clarity on whether this is accurate first.

Attachments (2)

42786.diff (1.1 KB) - added by stevenlinx 4 years ago.
42786.2.diff (1.1 KB) - added by stevenlinx 4 years ago.

Download all attachments as: .zip

Change History (9)

#1 @webdevmattcrom
4 years ago

  • Focuses docs added

This ticket was mentioned in Slack in #core-docs by webdevmattcrom. View the logs.

4 years ago

4 years ago

4 years ago

#3 @stevenlinx
4 years ago

  • Keywords has-patch added

Agreed to clarify the inline doc; however, we should use the same descriptions as the inline doc of add_settings_error().

The function handles the same "@global array $wp_settings_errors"

The inline doc description for $wp_settings_errors in both add_settings_error() and get_settings_errors() is also the same.

line in the code:

#4 @pento
3 years ago

  • Version trunk deleted

#5 @atachibana
2 years ago

@SergeyBiryukov Can I ask you to check this issue? I think this issue and patch make sense.

#6 @SergeyBiryukov
16 months ago

  • Component changed from General to Options, Meta APIs
  • Milestone changed from Awaiting Review to 5.6
  • 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 48760:

Docs: Document the return value of get_settings_errors() using hash notation.

Props stevenlinx, webdevmattcrom, atachibana.
Fixes #42786.

Note: See TracTickets for help on using tickets.