Changeset 9053 for trunk/wp-admin/includes/file.php
- Timestamp:
- 10/02/2008 01:03:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r8880 r9053 1 1 <?php 2 2 /** 3 * File contains all the administration image manipulation functions. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** The descriptions for theme files. */ 3 10 $wp_file_descriptions = array ( 4 11 'index.php' => __( 'Main Index Template' ), 5 12 'style.css' => __( 'Stylesheet' ), 6 'rtl.css' => __( 'RTL Stylesheet' ), 7 'comments.php' => __( 'Comments' ), 8 'comments-popup.php' => __( 'Popup Comments' ), 9 'footer.php' => __( 'Footer' ), 10 'header.php' => __( 'Header' ), 13 'rtl.css' => __( 'RTL Stylesheet' ), 14 'comments.php' => __( 'Comments' ), 15 'comments-popup.php' => __( 'Popup Comments' ), 16 'footer.php' => __( 'Footer' ), 17 'header.php' => __( 'Header' ), 11 18 'sidebar.php' => __( 'Sidebar' ), 12 19 'archive.php' => __( 'Archives' ), … … 28 35 // Deprecated files 29 36 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); 37 38 /** 39 * {@internal Missing Short Description}} 40 * 41 * @since unknown 42 * 43 * @param unknown_type $file 44 * @return unknown 45 */ 30 46 function get_file_description( $file ) { 31 47 global $wp_file_descriptions; … … 43 59 } 44 60 61 /** 62 * {@internal Missing Short Description}} 63 * 64 * @since unknown 65 * 66 * @return unknown 67 */ 45 68 function get_home_path() { 46 69 $home = get_option( 'home' ); … … 57 80 } 58 81 82 /** 83 * {@internal Missing Short Description}} 84 * 85 * @since unknown 86 * 87 * @param unknown_type $file 88 * @return unknown 89 */ 59 90 function get_real_file_to_edit( $file ) { 60 91 if ('index.php' == $file || '.htaccess' == $file ) { … … 66 97 return $real_file; 67 98 } 68 //$folder = Full path to folder 69 //$levels = Levels of folders to follow, Default: 100 (PHP Loop limit) 99 100 /** 101 * {@internal Missing Short Description}} 102 * 103 * @since unknown 104 * 105 * @param string $folder Optional. Full path to folder 106 * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit). 107 * @return bool|array 108 */ 70 109 function list_files( $folder = '', $levels = 100 ) { 71 110 if( empty($folder) ) … … 95 134 } 96 135 136 /** 137 * {@internal Missing Short Description}} 138 * 139 * @since unknown 140 * 141 * @return unknown 142 */ 97 143 function get_temp_dir() { 98 144 if ( defined('WP_TEMP_DIR') ) … … 109 155 } 110 156 157 /** 158 * {@internal Missing Short Description}} 159 * 160 * @since unknown 161 * 162 * @param unknown_type $filename 163 * @param unknown_type $dir 164 * @return unknown 165 */ 111 166 function wp_tempnam($filename = '', $dir = ''){ 112 167 if ( empty($dir) ) … … 121 176 } 122 177 178 /** 179 * {@internal Missing Short Description}} 180 * 181 * @since unknown 182 * 183 * @param unknown_type $file 184 * @param unknown_type $allowed_files 185 * @return unknown 186 */ 123 187 function validate_file_to_edit( $file, $allowed_files = '' ) { 124 188 $file = stripslashes( $file ); … … 141 205 } 142 206 143 // array wp_handle_upload ( array &file [, array overrides] ) 144 // file: reference to a single element of $_FILES. Call the function once for each uploaded file. 145 // overrides: an associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). 146 // On success, returns an associative array of file attributes. 147 // On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). 207 /** 208 * {@internal Missing Short Description}} 209 * 210 * @since unknown 211 * 212 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file. 213 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). 214 * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). 215 */ 148 216 function wp_handle_upload( &$file, $overrides = false ) { 149 217 // The default error handler. … … 237 305 return $return; 238 306 } 239 // Pass this function an array similar to that of a $_FILES POST array. 307 308 /** 309 * {@internal Missing Short Description}} 310 * 311 * Pass this function an array similar to that of a $_FILES POST array. 312 * 313 * @since unknown 314 * 315 * @param unknown_type $file 316 * @param unknown_type $overrides 317 * @return unknown 318 */ 240 319 function wp_handle_sideload( &$file, $overrides = false ) { 241 320 // The default error handler. … … 335 414 336 415 /** 337 * Downloads a url to a local file using the Snoopy HTTP Class 338 * 339 * @param string $url the URL of the file to download 340 * @return mixed WP_Error on failure, string Filename on success. 341 */ 416 * Downloads a url to a local file using the Snoopy HTTP Class. 417 * 418 * @since unknown 419 * @todo Transition over to using the new HTTP Request API (jacob). 420 * 421 * @param string $url the URL of the file to download 422 * @return mixed WP_Error on failure, string Filename on success. 423 */ 342 424 function download_url( $url ) { 343 425 //WARNING: The file is not automatically deleted, The script must unlink() the file. … … 368 450 } 369 451 452 /** 453 * {@internal Missing Short Description}} 454 * 455 * @since unknown 456 * 457 * @param unknown_type $file 458 * @param unknown_type $to 459 * @return unknown 460 */ 370 461 function unzip_file($file, $to) { 371 462 global $wp_filesystem; … … 428 519 } 429 520 521 /** 522 * {@internal Missing Short Description}} 523 * 524 * @since unknown 525 * 526 * @param unknown_type $from 527 * @param unknown_type $to 528 * @return unknown 529 */ 430 530 function copy_dir($from, $to) { 431 531 global $wp_filesystem; … … 453 553 } 454 554 555 /** 556 * {@internal Missing Short Description}} 557 * 558 * @since unknown 559 * 560 * @param unknown_type $args 561 * @return unknown 562 */ 455 563 function WP_Filesystem( $args = false ) { 456 564 global $wp_filesystem; … … 481 589 } 482 590 591 /** 592 * {@internal Missing Short Description}} 593 * 594 * @since unknown 595 * 596 * @param unknown_type $args 597 * @return unknown 598 */ 483 599 function get_filesystem_method($args = array()) { 484 600 $method = false; … … 496 612 } 497 613 614 /** 615 * {@internal Missing Short Description}} 616 * 617 * @since unknown 618 * 619 * @param unknown_type $form_post 620 * @param unknown_type $type 621 * @param unknown_type $error 622 * @return unknown 623 */ 498 624 function request_filesystem_credentials($form_post, $type = '', $error = false) { 499 625 $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error);
Note: See TracChangeset
for help on using the changeset viewer.