Changeset 9119 for trunk/wp-admin/includes/plugin-install.php
- Timestamp:
- 10/10/2008 06:21:16 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/plugin-install.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin-install.php
r9028 r9119 20 20 * 21 21 * The second filter, 'plugins_api', is the result that would be returned. 22 * 23 * @since 2.7.0 22 24 * 23 25 * @param string $action … … 45 47 46 48 /** 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 51 55 */ 52 56 function install_popular_tags( $args = array() ) { … … 68 72 69 73 add_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 */ 70 82 function install_search($page) { 71 83 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : ''; … … 112 124 <?php 113 125 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 */ 126 143 function install_search_form(){ 127 144 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : ''; … … 140 157 141 158 add_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 */ 142 167 function install_featured($page){ 143 168 $args = array('browse' => 'featured', 'page' => $page); … … 146 171 } 147 172 add_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 */ 148 181 function install_popular($page){ 149 182 $args = array('browse' => 'popular', 'page' => $page); … … 152 185 } 153 186 add_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 */ 154 195 function install_new($page){ 155 196 $args = array('browse' => 'new', 'page' => $page); … … 158 199 } 159 200 add_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 */ 160 209 function install_updated($page){ 161 210 $args = array('browse' => 'updated', 'page' => $page); … … 164 213 } 165 214 add_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 */ 166 223 function install_upload_custom($page){ 167 224 //$args = array('browse' => 'updated', 'page' => $page); … … 171 228 } 172 229 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 */ 173 239 function display_plugins_table($plugins, $page = 1, $totalpages = 1){ 174 240 global $tab; … … 286 352 } 287 353 354 /** 355 * Display iframe header. 356 * 357 * @since 2.7.0 358 * 359 * @param string $title Title for iframe. 360 */ 288 361 function install_iframe_header($title = '') { 289 362 if( empty($title) ) … … 318 391 } 319 392 393 /** 394 * Display iframe footer. 395 * 396 * @since 2.7.0 397 */ 320 398 function install_iframe_footer() { 321 399 echo ' … … 325 403 326 404 add_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 */ 327 411 function install_plugin_information() { 328 412 global $tab; … … 448 532 449 533 add_action('install_plugins_pre_install', 'install_plugin'); 534 535 /** 536 * Display plugin link and execute install. 537 * 538 * @since 2.7.0 539 */ 450 540 function install_plugin() { 451 541 … … 466 556 exit; 467 557 } 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 */ 567 function do_plugin_install($download_url = '', $plugin_information = null) { 469 568 global $wp_filesystem; 470 569 … … 513 612 } 514 613 614 /** 615 * Install plugin. 616 * 617 * @since 2.7.0 618 * 619 * @param string $package 620 * @param string $feedback Optional. 621 * @return mixed. 622 */ 515 623 function wp_install_plugin($package, $feedback = '') { 516 624 global $wp_filesystem;
Note: See TracChangeset
for help on using the changeset viewer.