WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 369 | $perms = $stat['mode'] & 0000666; |
| 370 | @ chmod( $new_file, $perms ); |
| 371 | |
| 372 | // Compute the URL |
| 373 | $url = $uploads['url'] . "/$filename"; |
| 374 | |
| 375 | if ( is_multisite() ) |
| 376 | delete_transient( 'dirsize_cache' ); |
| 377 | |
| 378 | return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' ); |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Handle sideloads, which is the process of retriving a media item from another server instead of |
| 383 | * a traditional media upload. This process involves sanitizing the filename, checking extensions |
| 384 | * for mime type, and moving the file to the appropriate directory within the uploads directory. |
| 385 | * |
| 386 | * @since 2.6.0 |
| 387 | * |
| Line | Code |
| 489 | |
| 490 | // Set correct file permissions |
| 491 | $stat = stat( dirname( $new_file )); |
| 492 | $perms = $stat['mode'] & 0000666; |
| 493 | @ chmod( $new_file, $perms ); |
| 494 | |
| 495 | // Compute the URL |
| 496 | $url = $uploads['url'] . "/$filename"; |
| 497 | |
| 498 | $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'sideload' ); |
| 499 | |
| 500 | return $return; |
| 501 | } |
| 502 | |
| 503 | /** |
| 504 | * Downloads a url to a local temporary file using the WordPress HTTP Class. |
| 505 | * Please note, That the calling function must unlink() the file. |
| 506 | * |
| 507 | * @since 2.5.0 |