From 5b07b691f77d8ae83ad5f415a44bf05913342fc8 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 27 Sep 2015 22:00:25 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@34641 git-svn-id: http://core.svn.wordpress.org/trunk@34605 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin-install.php | 22 ++++++++++++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 62799c3390..5599f9fc4d 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -20,6 +20,24 @@ * * The second filter, {@see 'plugins_api'}, is the result that would be returned. * + * Supported arguments per action: + * + * | Argument Name | query_plugins | plugin_information | hot_tags | hot_categories | + * | -------------------- | :-----------: | :----------------: | :------: | :------------: | + * | `$slug` | No | Yes | No | No | + * | `$per_page` | Yes | No | No | No | + * | `$page` | Yes | No | No | No | + * | `$number` | No | No | Yes | Yes | + * | `$search` | Yes | No | No | No | + * | `$tag` | Yes | No | No | No | + * | `$author` | Yes | No | No | No | + * | `$user` | Yes | No | No | No | + * | `$browse` | Yes | No | No | No | + * | `$locale` | Yes | Yes | No | No | + * | `$installed_plugins` | Yes | No | No | No | + * | `$is_ssl` | Yes | Yes | No | No | + * | `$fields` | Yes | Yes | No | No | + * * @since 2.7.0 * * @param string $action API action to perform: 'query_plugins', 'plugin_information', @@ -70,9 +88,9 @@ * @type bool $contributors Whether to return the list of contributors. Default false. * } * } - * @return object|WP_Error Response object on success, WP_Error on failure. See the + * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the * {@link https://developer.wordpress.org/reference/functions/plugins_api/ function reference article} - * for more information on the make-up of possible return objects depending on the value of `$action`. + * for more information on the make-up of possible return values depending on the value of `$action`. */ function plugins_api( $action, $args = array() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index b76ab026a2..2873dd488c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34640'; +$wp_version = '4.4-alpha-34641'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.