Make WordPress Core

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

File wp-admin-includes-plugin-install.25229.diff, 4.8 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..703bbbd 100644
     
    2222 *
    2323 * @since 2.7.0
    2424 *
    25  * @param string $action
    26  * @param array|object $args Optional. Arguments to serialize for the Plugin Info API.
     25 * @param string       $action Requested information.
     26 * @param array|object $args   Optional. Arguments to serialize for the Plugin Info API.
    2727 * @return object plugins_api response object on success, WP_Error on failure.
    2828 */
    2929function plugins_api($action, $args = null) {
    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.
     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 Requested information.
     46         */
    4047        $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 Requested information.
     58         * @param object      $args   Plugin API arguments.
     59         */
    4160        $res = apply_filters('plugins_api', false, $action, $args);
    4261
    4362        if ( false === $res ) {
    function plugins_api($action, $args = null) { 
    6483                $res->external = true;
    6584        }
    6685
     86        /**
     87         * Merely add a result.
     88         *
     89         * @since 2.7.0
     90         *
     91         * @param object $res    Response object or WP_Error.
     92         * @param string $action Requested information.
     93         * @param object $args   Plugin API arguments.
     94         */
    6795        return apply_filters('plugins_api_result', $res, $action, $args);
    6896}
    6997
    function plugins_api($action, $args = null) { 
    73101 * @since 2.7.0
    74102 *
    75103 * @param array $args
    76  * @return array
     104 * @return array Popular tags.
    77105 */
    78106function install_popular_tags( $args = array() ) {
    79107        $key = md5(serialize($args));
    function install_popular_tags( $args = array() ) { 
    90118        return $tags;
    91119}
    92120
     121/**
     122 * Display dashboard for the 'Install Plugins' page.
     123 *
     124 * @since 2.7.0
     125 *
     126 */
    93127function install_dashboard() {
    94128        ?>
    95129        <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.' ), 'http://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
    add_action('install_plugins_dashboard', 'install_dashboard'); 
    125159 * Display search form for searching plugins.
    126160 *
    127161 * @since 2.7.0
     162 *
     163 * @param bool $type_selector Choose a search type. Default is true.
    128164 */
    129165function install_search_form( $type_selector = true ) {
    130166        $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term';
    function install_search_form( $type_selector = true ) { 
    147183
    148184/**
    149185 * Upload from zip
     186 *
    150187 * @since 2.8.0
    151188 *
    152  * @param string $page
     189 * @param string $page Currently unused.
    153190 */
    154191function install_plugins_upload( $page = 1 ) {
    155192?>
    add_action('install_plugins_upload', 'install_plugins_upload', 10, 1); 
    167204
    168205/**
    169206 * Show a username form for the favorites page
     207 *
    170208 * @since 3.5.0
    171209 *
    172210 */
    function install_plugins_favorites_form() { 
    188226/**
    189227 * Display plugin content based on plugin list.
    190228 *
     229 * @global WP_Plugin_Install_List_Table $wp_list_table List of items to display.
     230 *
    191231 * @since 2.7.0
     232 *
    192233 */
    193234function display_plugins_table() {
    194235        global $wp_list_table;
    add_action( 'install_plugins_favorites', 'display_plugins_table' ); 
    207248/**
    208249 * Determine the status we can perform on a plugin.
    209250 *
     251 * This function is called recursively, $loop prevents further loops.
     252 *
    210253 * @since 3.0.0
     254 *
     255 * @param array|object $api  Plugin API response object.
     256 * @param bool         $loop Prevents further loops. Default is false.
     257 * @return array Plugin status, install URL, and version.
    211258 */
    212259function install_plugin_install_status($api, $loop = false) {
    213         // this function is called recursively, $loop prevents further loops.
    214260        if ( is_array($api) )
    215261                $api = (object) $api;
    216262
    function install_plugin_install_status($api, $loop = false) { 
    271317/**
    272318 * Display plugin information in dialog box form.
    273319 *
     320 * @global string $tab Requested information.
     321 *
    274322 * @since 2.7.0
     323 *
    275324 */
    276325function install_plugin_information() {
    277326        global $tab;