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.
| Line | Code |
|---|---|
| 410 | $slug = "$slug.$ext"; |
| 411 | $file = wp_upload_bits( $slug, NULL, $bits); |
| 412 | |
| 413 | log_app('wp_upload_bits returns:',print_r($file,true)); |
| 414 | |
| 415 | $url = $file['url']; |
| 416 | $file = $file['file']; |
| 417 | $filename = basename($file); |
| 418 | |
| 419 | $header = apply_filters('wp_create_file_in_uploads', $file); // replicate |
| 420 | |
| 421 | // Construct the attachment array |
| 422 | $attachment = array( |
| 423 | 'post_title' => $slug, |
| 424 | 'post_content' => $slug, |
| 425 | 'post_status' => 'attachment', |
| 426 | 'post_parent' => 0, |
| 427 | 'post_mime_type' => $type, |
| 428 | 'guid' => $url |