WordPress.org

Make WordPress Core

Ticket #14783: 14783.003.diff

File 14783.003.diff, 4.9 KB (added by sivel, 10 years ago)

phpdoc for wp-admin/includes/file.php

  • wp-admin/includes/file.php

     
    3939        'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' ));
    4040
    4141/**
    42  * {@internal Missing Short Description}}
     42 * Get the description for standard WordPress theme files and other various standard
     43 * WordPress files
    4344 *
    44  * @since unknown
     45 * @since 1.5.0
    4546 *
    46  * @param unknown_type $file
    47  * @return unknown
     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 ) {
    5053        global $wp_file_descriptions;
     
    6265}
    6366
    6467/**
    65  * {@internal Missing Short Description}}
     68 * Get the absolute filesystem path to the root of the WordPress installation
    6669 *
    67  * @since unknown
     70 * @since 1.5.0
    6871 *
    69  * @return unknown
     72 * @uses get_option
     73 * @return string Full filesystem path to the root of the WordPress installation
    7074 */
    7175function get_home_path() {
    7276        $home = get_option( 'home' );
     
    8488}
    8589
    8690/**
    87  * {@internal Missing Short Description}}
     91 * Get the real file system path to a file to edit within the admin
    8892 *
    89  * @since unknown
     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
    9096 *
    91  * @param unknown_type $file
    92  * @return unknown
     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 ) {
    95105        if ('index.php' == $file || '.htaccess' == $file ) {
     
    201211}
    202212
    203213/**
    204  * {@internal Missing Short Description}}
     214 * Make sure that the file that was requested to edit, is allowed to be edited
    205215 *
    206  * @since unknown
     216 * Function will die if if you are not allowed to edit the file
    207217 *
    208  * @param unknown_type $file
    209  * @param unknown_type $allowed_files
    210  * @return unknown
     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 = '' ) {
    213227        $code = validate_file( $file, $allowed_files );
     
    228242}
    229243
    230244/**
    231  * {@internal Missing Short Description}}
     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.
    232247 *
    233  * @since unknown
     248 * @since 2.0
    234249 *
     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 ).
    237260 * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
     
    352375}
    353376
    354377/**
    355  * {@internal Missing Short Description}}
     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.
    356381 *
    357  * Pass this function an array similar to that of a $_FILES POST array.
     382 * @since 2.6.0
    358383 *
    359  * @since unknown
    360  *
    361  * @param unknown_type $file
    362  * @param unknown_type $overrides
    363  * @return unknown
     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 ) {
    366395        // The default error handler.