Opened 10 years ago
Closed 9 years ago
#30315 closed defect (bug) (fixed)
Improve inline documentation of widgets API
Reported by: | ericlewis | Owned by: | |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
There's a few places we need more documentation, and the existing documentation is misleading, especially in defining instances of widgets vs widget classes.
Attachments (6)
Change History (20)
#1
@
10 years ago
- Component changed from General to Widgets
- Focuses docs added
- Keywords has-patch commit added
- Milestone changed from Awaiting Review to 4.1
#3
@
10 years ago
Although I understand that it would be nice to get @since
tags, I disagree with the approach that docs is an all-or-no-commit venture. More documentation is better than no documentation, and improved documentation is better than existing documentation. If someone wants to update just the description of a single parameter to a function, I think they should be able to make that contribution without any more barrier to contribution.
Here, I needed to figure out some widgets internals for my day job, so I added the documentation that I needed to get me through, and hope(/know) it will benefit other WordPress developers. If I'm responsible for adding @since
tags whenever I touch any documentation, I'm not going to contribute as much.
@
10 years ago
Cleaned up some comments and added @since versions to the docblocks added in the previous patch
#6
@
10 years ago
Looks like [30382] missed the ticket. That covered the changes submitted by @ericlewis and @jazzs3quence.
#7
@
10 years ago
Hi Ben, thanks for the patches.
Please refer to the Parameters that are arrays section of the standard for a refresher on the syntax for hash notations. The example provided there is meant to be used as an exact guide for what's expected.
- The inner hash notation should only be indented four spaces
- Descriptions including the hash description should always end with a period. They're very literally sentences
- There should be a blank line between the summary and description
- Parameter and return descriptions should always end with a period
- The return type should be
int
and there should be a description (with a period)
- The hash notation should begin with a description, followed by a blank line, followed by the
@type
lines - Each
@type
line should only be indented four spaces - The types and descriptions should be left-aligned with each other
- The descriptions should mention what type of values are accepted and what the defaults are.
It would be great if you could add the
@since
versions on the methods you're adding docs to. If we're going to add docs where none previously were, I'd like to be as complete as possible so as not to create additional future work.