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
298
299      // Set correct file permissions
300      $stat = stat( dirname( $new_file ));
301      $perms = $stat['mode'] & 0000666;
302      @ chmod( $new_file, $perms );
303
304      // Compute the URL
305      $url = $uploads['url'] . "/$filename";
306
307      $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
308
309      return $return;
310 }
311
312 /**
313  * {@internal Missing Short Description}}
314  *
315  * Pass this function an array similar to that of a $_FILES POST array.
316  *
 
Line Code
408
409      // Set correct file permissions
410      $stat = stat( dirname( $new_file ));
411      $perms = $stat['mode'] & 0000666;
412      @ chmod( $new_file, $perms );
413
414      // Compute the URL
415      $url = $uploads['url'] . "/$filename";
416
417      $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
418
419      return $return;
420 }
421
422 /**
423  * Downloads a url to a local file using the Snoopy HTTP Class.
424  *
425  * @since unknown
426  * @todo Transition over to using the new HTTP Request API (jacob).