Opened 9 years ago
Closed 9 years ago
#34035 closed defect (bug) (fixed)
Document $args parameter for plugins_api()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
The $args
parameter in plugins_api()
needs some docs.
Attachments (6)
Change History (23)
#2
@
9 years ago
I think we should also switch the default value of $args. It should be an empty array otherwise plugins_api( 'hot_tags' );
is producing a warning: "Warning: Creating default object from empty value in /src/wp-admin/includes/plugin-install.php on line 71".
#3
@
9 years ago
- Owner set to DrewAPicture
- Status changed from new to reviewing
34035.2.patch looks a lot better. The keyword we typically use with booleans is "whether", so "Whether to return _. Default true", for instance. I can fix that on commit.
After some discussion with @ocean90, I think our best course of action is to provide supplementary information on success object structs as an "Explanation" on the function reference page. This would be instead of trying to jam all of that into the inline docs. The major upside is that we generally have a lot more control over formatting, external linking, etc. in the WordPress editor on DevHub than we do in hash notations currently.
#5
@
9 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
I've missed some: $browse, $user, $search, $author, $tag, $installed_plugins, $page.
#7
@
9 years ago
- Keywords has-patch added; needs-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
- The function returns an array for hot_tags' and 'hot_categories'.
- Add a matrix for which arguments are availablefor each of the actions.
#15
@
9 years ago
- Owner changed from DrewAPicture to ocean90
@ocean90 I think we're good on the docs aspect.
If 'hot_tags' and 'hot_categories' return an array as you said, should we not either cast that response as an object regardless or handle the array case? This would be for the case where the object/array is being replaced using the plugins_api
hook. I suppose handling that in a separate ticket might be best.
#17
@
9 years ago
- Resolution set to fixed
- Status changed from reviewing to closed
Disregard my comment:15, I misread the code. Calling this fixed.
34035.patch is a really great start. All we need now are descriptions for all of the values in the
$fields
array.