WordPress.org

Make WordPress Core

Changeset 16024


Ignore:
Timestamp:
10/27/2010 10:24:06 PM (10 years ago)
Author:
nacin
Message:

Docs for wp-admin/includes/file.php. props sivel, see #14783.

File:
1 edited

Legend:

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

    r15593 r16024  
    4040
    4141/**
    42  * {@internal Missing Short Description}}
    43  *
    44  * @since unknown
    45  *
    46  * @param unknown_type $file
    47  * @return unknown
     42 * Get the description for standard WordPress theme files and other various standard
     43 * WordPress files
     44 *
     45 * @since 1.5.0
     46 *
     47 * @uses _cleanup_header_comment
     48 * @uses $wp_file_descriptions
     49 * @param string $file Filesystem path or filename
     50 * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist
    4851 */
    4952function get_file_description( $file ) {
     
    6366
    6467/**
    65  * {@internal Missing Short Description}}
    66  *
    67  * @since unknown
    68  *
    69  * @return unknown
     68 * Get the absolute filesystem path to the root of the WordPress installation
     69 *
     70 * @since 1.5.0
     71 *
     72 * @uses get_option
     73 * @return string Full filesystem path to the root of the WordPress installation
    7074 */
    7175function get_home_path() {
     
    8589
    8690/**
    87  * {@internal Missing Short Description}}
    88  *
    89  * @since unknown
    90  *
    91  * @param unknown_type $file
    92  * @return unknown
     91 * Get the real file system path to a file to edit within the admin
     92 *
     93 * If the $file is index.php or .htaccess this function will assume it is relative
     94 * to the install root, otherwise it is assumed the file is relative to the wp-content
     95 * directory
     96 *
     97 * @since 1.5.0
     98 *
     99 * @uses get_home_path
     100 * @uses WP_CONTENT_DIR full filesystem path to the wp-content directory
     101 * @param string $file filesystem path relative to the WordPress install directory or to the wp-content directory
     102 * @return string full file system path to edit
    93103 */
    94104function get_real_file_to_edit( $file ) {
     
    202212
    203213/**
    204  * {@internal Missing Short Description}}
    205  *
    206  * @since unknown
    207  *
    208  * @param unknown_type $file
    209  * @param unknown_type $allowed_files
    210  * @return unknown
     214 * Make sure that the file that was requested to edit, is allowed to be edited
     215 *
     216 * Function will die if if you are not allowed to edit the file
     217 *
     218 * @since 1.5.0
     219 *
     220 * @uses wp_die
     221 * @uses validate_file
     222 * @param string $file file the users is attempting to edit
     223 * @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly
     224 * @return null
    211225 */
    212226function validate_file_to_edit( $file, $allowed_files = '' ) {
     
    229243
    230244/**
    231  * {@internal Missing Short Description}}
    232  *
    233  * @since unknown
    234  *
     245 * Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
     246 * and moving the file to the appropriate directory within the uploads directory.
     247 *
     248 * @since 2.0
     249 *
     250 * @uses wp_handle_upload_error
     251 * @uses apply_filters
     252 * @uses is_multisite
     253 * @uses wp_check_filetype_and_ext
     254 * @uses current_user_can
     255 * @uses wp_upload_dir
     256 * @uses wp_unique_filename
     257 * @uses delete_transient   
    235258 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
    236259 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
     
    353376
    354377/**
    355  * {@internal Missing Short Description}}
    356  *
    357  * Pass this function an array similar to that of a $_FILES POST array.
    358  *
    359  * @since unknown
    360  *
    361  * @param unknown_type $file
    362  * @param unknown_type $overrides
    363  * @return unknown
     378 * Handle sideloads, which is the process of retriving a media item from another server instead of
     379 * a traditional media upload.  This process involves sanitizing the filename, checking extensions
     380 * for mime type, and moving the file to the appropriate directory within the uploads directory.
     381 *
     382 * @since 2.6.0
     383 *
     384 * @uses wp_handle_upload_error
     385 * @uses apply_filters
     386 * @uses wp_check_filetype_and_ext
     387 * @uses current_user_can
     388 * @uses wp_upload_dir
     389 * @uses wp_unique_filename
     390 * @param array $file an array similar to that of a PHP $_FILES POST array
     391 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
     392 * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
    364393 */
    365394function wp_handle_sideload( &$file, $overrides = false ) {
Note: See TracChangeset for help on using the changeset viewer.