Opened 4 years ago
Closed 4 years ago
#47725 closed enhancement (duplicate)
wp_parse_args_deep
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.3 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
It would be nice if WP had built-in wp_parse_args for recursive usage (multi-dimensional arrays).
The concept is written here: https://mekshq.com/recursive-wp-parse-args-wordpress-function/
I am new to submitting patches, so my applied patch might need correction. thanks.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Thank you for the suggestion and patch, @tazotodua!
This is an interesting idea, but as described in #19888, I don't think it's a good option for core.
For the example you describe in your post, you could just use
array_merge_recursive()
, instead.wp_parse_args()
is mostly just a helper function that runswp_parse_str()
first (in case the args are passed as a string), then runs anarray_merge()
.