#57323 closed defect (bug) (fixed)
get_settings_errors() inline docs return should reflect the array of arrays
Reported by: | mcaskill | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Options, Meta APIs | Keywords: | has-patch commit |
Focuses: | docs | Cc: |
Description
The function returns an array of setting error arrays but the inline doc suggests it returns only a single setting error array. This causes problems with static analysis tools and can be misinterpreted by developers.
This issue is present since 5.6: https://core.trac.wordpress.org/changeset/48760
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Hi @mcaskill, thanks for opening this ticket and well spotted!
Just a quick note that the
Version
property of tickets refers to the version that introduced the issue, which as you noted in the ticket description, was 5.6.While [48760] changed
@return array
to add more detail, I agree that this could be clearer to avoid confusion.For others' reference, here's a sample return value of
get_settings_errors()
:array ( 0 => array ( 'setting' => 'new_admin_email', 'code' => 'invalid_new_admin_email', 'message' => 'The email address entered did not appear to be a valid email address. Please enter a valid email address.', 'type' => 'error', ), );
The patch looks good to me. Adding for
commit
consideration.