Description
Deliver the theme version requested
Usage
oikth_download_file( $theme, $version, $apikey, $id );Parameters
- $theme
- ( mixed ) required –
- $version
- ( mixed ) required –
- $apikey
- ( mixed ) required –
- $id
- ( mixed ) required –
Returns
voidSource
File name: oik-themes/feed/oik-themes-feed.phpLines:
1 to 29 of 29
function oikth_download_file( $theme, $version, $apikey, $id ) { $theme_version = get_post( $id ); bw_trace2( $theme_version ); /* check the $version and $theme for the post version that we have loaded */ $response = oikth_validate_themeversion( $theme_version, $theme, $version, $apikey ); if ( !is_wp_error( $response ) ) { $file = oikth_get_attachment( $theme_version ); if ( $file ) { oikth_increment_downloads( $id ); if ( $theme_version->post_type == "oik_themiumversion" ) { $file = oikth_create_new_file_name( $file ); } else { $upload_dir = wp_upload_dir(); $baseurl = $upload_dir['baseurl']; $file = $baseurl . "/". $file; } oikth_force_download( $file ); // Nothing happens after this } else { $response = bw_wp_error( "not-found", "Attachment not found" ); } } else { //oikth_error( __FUNCTION__ ); bw_trace2(); //$response = bw_wp_error( "not-found", "theme version not found" ); } echo serialize( $response ); }View on GitHub
Called by
1 to 1 of 1
Invoked by
Calls
1 to 7 of 7
- bw_trace2() – Trace $value to the trace log file if tracing is active
- bw_wp_error() –
- oikth_create_new_file_name() – Can we alter the filter in wp_handle_upload to control where the file gets stored and the download URL for it?
- oikth_force_download() – Force the download of a file
- oikth_get_attachment() –
- oikth_increment_downloads() – Increment the downloads for this theme version
- oikth_validate_themeversion() – validate the theme and version against the given post ID
Call hooks
API Letters:
