Make WordPress Core


Ignore:
Timestamp:
10/10/2008 06:21:16 PM (17 years ago)
Author:
ryan
Message:

phpdoc for wp-admin. Props jacobsantos. see #7527

File:
1 edited

Legend:

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

    r9028 r9119  
    2020 *
    2121 * The second filter, 'plugins_api', is the result that would be returned.
     22 *
     23 * @since 2.7.0
    2224 *
    2325 * @param string $action
     
    4547
    4648/**
    47  *
    48  *
    49  * @param unknown_type $args
    50  * @return unknown
     49 * Retrieve popular WordPress plugin tags.
     50 *
     51 * @since 2.7.0
     52 *
     53 * @param array $args
     54 * @return array
    5155 */
    5256function install_popular_tags( $args = array() ) {
     
    6872
    6973add_action('install_plugins_search', 'install_search', 10, 1);
     74
     75/**
     76 * Display search results and display as tag cloud.
     77 *
     78 * @since 2.7.0
     79 *
     80 * @param string $page
     81 */
    7082function install_search($page) {
    7183    $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
     
    112124    <?php
    113125
    114         $api_tags = install_popular_tags();
    115 
    116         //Set up the tags in a way which can be interprated by wp_generate_tag_cloud()
    117         $tags = array();
    118         foreach ( (array)$api_tags as $tag )
    119             $tags[ $tag['name'] ] = (object) array(
    120                                     'link' => clean_url( admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ),
    121                                     'name' => $tag['name'],
    122                                     'count' => $tag['count'] );
    123         echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) );
    124 }
    125 
     126    $api_tags = install_popular_tags();
     127
     128    //Set up the tags in a way which can be interprated by wp_generate_tag_cloud()
     129    $tags = array();
     130    foreach ( (array)$api_tags as $tag )
     131        $tags[ $tag['name'] ] = (object) array(
     132                                'link' => clean_url( admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ),
     133                                'name' => $tag['name'],
     134                                'count' => $tag['count'] );
     135    echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) );
     136}
     137
     138/**
     139 * Display search form for searching plugins.
     140 *
     141 * @since 2.7.0
     142 */
    126143function install_search_form(){
    127144    $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
     
    140157
    141158add_action('install_plugins_featured', 'install_featured', 10, 1);
     159
     160/**
     161 * Display featured plugins.
     162 *
     163 * @since 2.7.0
     164 *
     165 * @param string $page
     166 */
    142167function install_featured($page){
    143168    $args = array('browse' => 'featured', 'page' => $page);
     
    146171}
    147172add_action('install_plugins_popular', 'install_popular', 10, 1);
     173
     174/**
     175 * Display popular plugins.
     176 *
     177 * @since 2.7.0
     178 *
     179 * @param string $page
     180 */
    148181function install_popular($page){
    149182    $args = array('browse' => 'popular', 'page' => $page);
     
    152185}
    153186add_action('install_plugins_new', 'install_new', 10, 1);
     187
     188/**
     189 * Display new plugins.
     190 *
     191 * @since 2.7.0
     192 *
     193 * @param string $page
     194 */
    154195function install_new($page){
    155196    $args = array('browse' => 'new', 'page' => $page);
     
    158199}
    159200add_action('install_plugins_updated', 'install_updated', 10, 1);
     201
     202/**
     203 * Display recently updated plugins.
     204 *
     205 * @since 2.7.0
     206 *
     207 * @param string $page
     208 */
    160209function install_updated($page){
    161210    $args = array('browse' => 'updated', 'page' => $page);
     
    164213}
    165214add_action('install_plugins_upload', 'install_upload_custom', 10, 1);
     215
     216/**
     217 * Display upload plugin form for adding plugins by uploading them manually.
     218 *
     219 * @since 2.7.0
     220 *
     221 * @param string $page
     222 */
    166223function install_upload_custom($page){
    167224    //$args = array('browse' => 'updated', 'page' => $page);
     
    171228}
    172229
     230/**
     231 * Display plugin content based on plugin list.
     232 *
     233 * @since 2.7.0
     234 *
     235 * @param array $plugins List of plugins.
     236 * @param string $page
     237 * @param int $totalpages Number of pages.
     238 */
    173239function display_plugins_table($plugins, $page = 1, $totalpages = 1){
    174240    global $tab;
     
    286352}
    287353
     354/**
     355 * Display iframe header.
     356 *
     357 * @since 2.7.0
     358 *
     359 * @param string $title Title for iframe.
     360 */
    288361function install_iframe_header($title = '') {
    289362if( empty($title) )
     
    318391}
    319392
     393/**
     394 * Display iframe footer.
     395 *
     396 * @since 2.7.0
     397 */
    320398function install_iframe_footer() {
    321399echo '
     
    325403
    326404add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
     405
     406/**
     407 * Display plugin information in dialog box form.
     408 *
     409 * @since 2.7.0
     410 */
    327411function install_plugin_information() {
    328412    global $tab;
     
    448532
    449533add_action('install_plugins_pre_install', 'install_plugin');
     534
     535/**
     536 * Display plugin link and execute install.
     537 *
     538 * @since 2.7.0
     539 */
    450540function install_plugin() {
    451541
     
    466556    exit;
    467557}
    468 function do_plugin_install($download_url = '', $plugin_information = NULL) {
     558
     559/**
     560 * Retrieve plugin and install.
     561 *
     562 * @since 2.7.0
     563 *
     564 * @param string $download_url Optional. Download URL.
     565 * @param object $plugin_information Optional. Plugin information
     566 */
     567function do_plugin_install($download_url = '', $plugin_information = null) {
    469568    global $wp_filesystem;
    470569
     
    513612}
    514613
     614/**
     615 * Install plugin.
     616 *
     617 * @since 2.7.0
     618 *
     619 * @param string $package
     620 * @param string $feedback Optional.
     621 * @return mixed.
     622 */
    515623function wp_install_plugin($package, $feedback = '') {
    516624    global $wp_filesystem;
Note: See TracChangeset for help on using the changeset viewer.