Make WordPress Core

Opened 2 years ago

Last modified 5 months ago

#42786 new defect (bug)

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

Reported by: webdevmattcrom Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General 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 2 years ago.
42786.2.diff (1.1 KB) - added by stevenlinx 2 years ago.

Download all attachments as: .zip

Change History (7)

#1 @webdevmattcrom
2 years ago

  • Focuses docs added

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

2 years ago

2 years ago

2 years ago

#3 @stevenlinx
2 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
17 months ago

  • Version trunk deleted

#5 @atachibana
5 months ago

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

Note: See TracTickets for help on using tickets.