Description
Implement 'wp_handle_upload' filterIn [bw_plug name="easy-digital-downloads"] the files are uploaded to an 'edd' directory in the uploads folder if the post type of the current post is "download" and the current page ( $pagenow ) is 'async-upload.php' or 'media-upload.php' Here we check for a zip file ( with theme name and version number) being uploaded for post_type "oik_themiumversion" If so the file is renamed ( moved ) to a secret target directory if not then we don't do anything In either case the attachment is recorded as if the file has been stored in the uploads
C:\apache\htdocs\wordpress\wp-includes\theme.php(142:0) 2012-07-23T21:46:22+00:00 8485 cf! apply_filters(14338) 3 Array ( [0] => wp_handle_upload [1] => Array ( [file] => C:\apache\htdocs\wordpress/wp-content/uploads/2012/07/blogger-301-redirect.1.9.51.zip [url] => http://qw/wordpress/wp-content/uploads/2012/07/blogger-301-redirect.1.9.51.zip [type] => application/zip ) [2] => upload )
Usage
oikth_handle_upload( $file, $action );Parameters
- $file
- ( array ) required – array containing file, url and type
- $action
- ( mixed ) required –
Returns
voidSource
File name: oik-themes/oik-themes.phpLines:
1 to 15 of 15
function oikth_handle_upload( $file, $action ) { bw_trace2(); $type = bw_array_get( $file, "type", null ); if ( $type == "application/zip" ) { $rename = oikth_check_post_type( "oik_themiumversion" ); if ( $rename ) { $old_file = bw_array_get( $file, 'file', null ); $new_file = oikth_create_new_file_name( $old_file ); if ( $new_file ) { $renamed = rename( $old_file, $new_file ); } } } return( $file ); }View on GitHub
Called by
Calls
1 to 3 of 3
Call hooks
API Letters:
