Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34036 closed defect (bug) (fixed)

Document $args parameter for themes_api()

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: docs Cc:


The $args parameter in themes_api() needs some docs.

Related: #34035 (plugins_api())

Attachments (2)

34036.patch (5.0 KB) - added by ocean90 9 years ago.
34036.2.patch (6.2 KB) - added by ocean90 9 years ago.

Download all attachments as: .zip

Change History (13)

#1 @DrewAPicture
9 years ago


9 years ago

#2 @ocean90
9 years ago

  • Keywords has-patch added; needs-patch removed

#3 @DrewAPicture
9 years ago

  • Owner set to DrewAPicture
  • Status changed from new to reviewing

9 years ago

#4 @DrewAPicture
9 years ago

In 34640:

Docs: Vastly improve documentation for themes_api().


  • A hash notation with descriptions for all accepted arguments
  • A matrix-like data table demonstrating which arguments are available for the different $action types
  • A better summary and description with linked hooks
  • An improved return description with a link to external information

Props ocean90.
See #34036.

#5 @DrewAPicture
9 years ago

In 34648:

Docs: Adjust the themes_api() DocBlock description to clarify the "second" available hook, themes_api, and add new information for the "third" hook, themes_api_result.

See #34036.

#6 @DrewAPicture
9 years ago

In 34649:

Docs: Fix two typos in the DocBlock description for themes_api():

  • The fourth $action type is 'feature_list'
  • The first $action type in the data table should be 'query_themes'

See #34036.

#7 @DrewAPicture
9 years ago

In 34650:

Docs: Normalize the data table spacing in the themes_api() DocBlock following a typo fix in [34649].

See #34036.

#8 @DrewAPicture
9 years ago

In 34651:

Docs: Improve the hook documentation for the themes_api filter.

Standardizes the hook doc summary and expands on expected behavior when short-circuiting the request, which is dependent on the $action type.

Also updates the expected types on the $override parameter.

See #34036. See #32246.

#9 @DrewAPicture
9 years ago

  • Owner changed from DrewAPicture to ocean90

@ocean90 Does the 'feature_list' $action also return an array like 'hot_tags' and 'hot_categories' do in plugins_api()? I'm happy to adjust the docs as such.

Either way, the same question as comment:15:ticket:34035 applies here as well (concerning whether we need to cast the response if it's being overridden).

#10 @obenland
9 years ago

@DrewAPicture: Does that help?
It's current as of March 2015, there shouldn't have been too many changes since then.

#11 @DrewAPicture
9 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

Disregard my comment:9, misread the code for array vs object handling.

Closing as fixed. Go team.

Note: See TracTickets for help on using tickets.