Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_handle_upload

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
342      $perms = $stat['mode'] & 0000666;
343      @ chmod( $new_file, $perms );
344
345      // Compute the URL
346      $url = $uploads['url'] . "/$filename";
347
348      if ( is_multisite() )
349           delete_transient( 'dirsize_cache' );
350
351      return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' );
352 }
353
354 /**
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  *
 
Line Code
456
457      // Set correct file permissions
458      $stat = stat( dirname( $new_file ));
459      $perms = $stat['mode'] & 0000666;
460      @ chmod( $new_file, $perms );
461
462      // Compute the URL
463      $url = $uploads['url'] . "/$filename";
464
465      $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'sideload' );
466
467      return $return;
468 }
469
470 /**
471  * Downloads a url to a local temporary file using the WordPress HTTP Class.
472  * Please note, That the calling function must unlink() the  file.
473  *
474  * @since 2.5.0