Opened 9 years ago
Closed 9 years ago
#34857 closed defect (bug) (fixed)
Improve documentation for wp_admin_css_color()
Reported by: | swissspidy | Owned by: | kiranpotphode |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | good-first-bug has-patch commit |
Focuses: | docs | Cc: |
Description
As per the @todo
comment in wp_admin_css_color()
, the function's optional parameters need some love.
There's a usage example in the description, but from looking at the params alone it's not clear what exactly you can pass and what the default param (empty array) means. Also, the punctuation is not 100% correct.
See the PHP documentation standards for more details.
Attachments (2)
Change History (10)
#2
@
9 years ago
- Keywords has-patch added; needs-patch removed
Any guidelines on hash notations where arguments have no key-value pair but accepts definite number of parameters?
For example in this case $colors argument accepts 4 parameters but lacks keys for parameters.
#3
follow-up:
↓ 4
@
9 years ago
- Milestone changed from Awaiting Review to Future Release
- Owner set to kiranpotphode
- Status changed from new to assigned
Any guidelines on hash notations where arguments have no key-value pair but accepts definite number of parameters?
For example in this case $colors argument accepts 4 parameters but lacks keys for parameters.
@DrewAPicture to the rescue? :-)
#4
in reply to:
↑ 3
@
9 years ago
Replying to swissspidy:
Any guidelines on hash notations where arguments have no key-value pair but accepts definite number of parameters?
For example in this case $colors argument accepts 4 parameters but lacks keys for parameters.
@DrewAPicture to the rescue? :-)
We don't document flat arrays in hash notations. I would suggest documenting the accepted values, types, and exact order required in the parameter description.
$colors array does not have any keys but accepts four parameters. So hash notations for $colors argument are missing key|value.