Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Created July 5, 2013 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/5931567 to your computer and use it in GitHub Desktop.
Save wokamoto/5931567 to your computer and use it in GitHub Desktop.
<?php
add_action('StaticPress::file_put', 'static_press_upload', 10, 2);
function static_press_upload($file_dest, $url){
$s3_bucket = 'bucket_name';
$s3_key = preg_replace('#^(https?://[^/]+/|/)#i', '', urldecode($url));
$result = my_s3_upload_function($file_dest, $s3_bucket, $s3_key);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment