Make WordPress Core

Ticket #25229: wp-admin-includes-plugin-install.25229.2.diff

File wp-admin-includes-plugin-install.25229.2.diff, 2.0 KB (added by naomicbush, 11 years ago)

wp-admin/includes/plugin-install.php

  • wp-admin/includes/plugin-install.php

    diff --git wp-admin/includes/plugin-install.php wp-admin/includes/plugin-install.php
    index e1c1ec0..0776ee3 100644
    function plugins_api($action, $args = null) { 
    3434        if ( !isset($args->per_page) )
    3535                $args->per_page = 24;
    3636
    37         // Allows a plugin to override the WordPress.org API entirely.
    38         // Use the filter 'plugins_api_result' to merely add results.
    39         // Please ensure that a object is returned from the following filters.
    40         $args = apply_filters('plugins_api_args', $args, $action);
    41         $res = apply_filters('plugins_api', false, $action, $args);
     37        /**
     38         * Override the Plugin API arguments.
     39         *
     40         * Please ensure that an object is returned.
     41         *
     42         * @since 2.7.0
     43         *
     44         * @param object $args   Plugin API arguments.
     45         * @param string $action The type of information being requested from the Plugin API.
     46         */
     47        $args = apply_filters( 'plugins_api_args', $args, $action );
     48
     49        /**
     50         * Allows a plugin to override the WordPress.org API entirely.
     51         *
     52         * Please ensure that an object is returned.
     53         *
     54         * @since 2.7.0
     55         *
     56         * @param bool|object         The result object. Default is false.
     57         * @param string      $action The type of information being requested from the Plugin API.
     58         * @param object      $args   Plugin API arguments.
     59         */
     60        $res = apply_filters( 'plugins_api', false, $action, $args );
    4261
    4362        if ( false === $res ) {
    4463                $url = 'http://api.wordpress.org/plugins/info/1.0/';
    function plugins_api($action, $args = null) { 
    6483                $res->external = true;
    6584        }
    6685
    67         return apply_filters('plugins_api_result', $res, $action, $args);
     86        /**
     87         * Add a result to the Plugin API response.
     88         *
     89         * @since 2.7.0
     90         *
     91         * @param object $res    Response object or WP_Error.
     92         * @param string $action The type of information being requested from the Plugin API.
     93         * @param object $args   Plugin API arguments.
     94         */
     95        return apply_filters( 'plugins_api_result', $res, $action, $args );
    6896}
    6997
    7098/**