Make WordPress Core

Changeset 34641


Ignore:
Timestamp:
09/27/2015 09:59:12 PM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Further improve documentation for plugins_api().

  • Adds a matrix-like data table demonstrating which arguments are available for the different $action types
  • Adjusts the return types to accommodate an array for the 'hot_tags' $action choice

Props ocean90.
See #34035.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r34631 r34641  
    2020 *
    2121 * The second filter, {@see 'plugins_api'}, is the result that would be returned.
     22 *
     23 * Supported arguments per action:
     24 *
     25 * | Argument Name        | query_plugins | plugin_information | hot_tags | hot_categories |
     26 * | -------------------- | :-----------: | :----------------: | :------: | :------------: |
     27 * | `$slug`              | No            |  Yes               | No       | No             |
     28 * | `$per_page`          | Yes           |  No                | No       | No             |
     29 * | `$page`              | Yes           |  No                | No       | No             |
     30 * | `$number`            | No            |  No                | Yes      | Yes            |
     31 * | `$search`            | Yes           |  No                | No       | No             |
     32 * | `$tag`               | Yes           |  No                | No       | No             |
     33 * | `$author`            | Yes           |  No                | No       | No             |
     34 * | `$user`              | Yes           |  No                | No       | No             |
     35 * | `$browse`            | Yes           |  No                | No       | No             |
     36 * | `$locale`            | Yes           |  Yes               | No       | No             |
     37 * | `$installed_plugins` | Yes           |  No                | No       | No             |
     38 * | `$is_ssl`            | Yes           |  Yes               | No       | No             |
     39 * | `$fields`            | Yes           |  Yes               | No       | No             |
    2240 *
    2341 * @since 2.7.0
     
    7189 *     }
    7290 * }
    73  * @return object|WP_Error Response object on success, WP_Error on failure. See the
     91 * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the
    7492 *         {@link https://developer.wordpress.org/reference/functions/plugins_api/ function reference article}
    75  *         for more information on the make-up of possible return objects depending on the value of `$action`.
     93 *         for more information on the make-up of possible return values depending on the value of `$action`.
    7694 */
    7795function plugins_api( $action, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.