Make WordPress Core


Ignore:
Timestamp:
10/02/2015 04:47:14 AM (9 years ago)
Author:
DrewAPicture
Message:

Docs: Clarify the expected replacement element type if replacing the object or array in plugins_api() via the plugins_api hook.

If the $action type is 'query_plugins' or 'plugin_information', the API will return an object, thus an object should be passed if replacing it. For 'hot_tags' and 'hot_categories', the same logic applies, but with arrays instead.

See #34035.

File:
1 edited

Legend:

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

    r34652 r34763  
    2020 *
    2121 * The second filter, {@see 'plugins_api'}, allows a plugin to override the WordPress.org
    22  * Plugin Install API entirely. If `$action` is 'query_plugins', 'plugin_information', or
    23  * 'hot_categories', an object MUST be passed. If `$action` is 'hot_tags`, an array should
     22 * Plugin Install API entirely. If `$action` is 'query_plugins' or 'plugin_information',
     23 * an object MUST be passed. If `$action` is 'hot_tags` or 'hot_categories', an array MUST
    2424 * be passed.
    2525 *
Note: See TracChangeset for help on using the changeset viewer.