WordPress.org

Make WordPress Core

Changeset 34647


Ignore:
Timestamp:
09/27/2015 10:28:38 PM (4 years ago)
Author:
DrewAPicture
Message:

Docs: Improve the hook documentation for the plugins_api filter.

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

See #34035. See #32246.

File:
1 edited

Legend:

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

    r34645 r34647  
    126126
    127127    /**
    128      * Allows a plugin to override the WordPress.org Plugin Install API entirely.
    129      *
    130      * Please ensure that an object is returned.
     128     * Filter the response for the current WordPress.org Plugin Install API request.
     129     *
     130     * Passing a non-false value will effectively short-circuit the WordPress.org API request.
     131     *
     132     * If `$action` is 'query_plugins', 'plugin_information', or 'hot_categories', an object MUST
     133     * be passed. If `$action` is 'hot_tags`, an array should be passed.
    131134     *
    132135     * @since 2.7.0
    133136     *
    134      * @param bool|object $result The result object. Default false.
    135      * @param string      $action The type of information being requested from the Plugin Install API.
    136      * @param object      $args   Plugin API arguments.
     137     * @param false|object|array $result The result object or array. Default false.
     138     * @param string             $action The type of information being requested from the Plugin Install API.
     139     * @param object             $args   Plugin API arguments.
    137140     */
    138141    $res = apply_filters( 'plugins_api', false, $action, $args );
Note: See TracChangeset for help on using the changeset viewer.