Method |
Description |
|
__construct ( $bucket, $key, $secret, $bucket_url = null, $region = null ) |
|
|
copy_image_from_s3 ( string $file ) : string |
Get a local copy of the file. |
|
filter_editors ( $editors ) |
|
|
filter_sideload_move_temp_file_to_s3 ( array $file ) : array |
Copy the file from /tmp to an s3 dir so handle_sideload doesn't fail due to
trying to do a rename() on the file cross streams. This is somewhat of a hack
to work around the core issue https://core.trac.wordpress.org/ticket/29257 |
|
filter_upload_dir ( $dirs ) |
|
|
get_instance ( ) : S3_Uploads |
|
|
get_original_upload_dir ( ) |
|
|
get_s3_bucket ( ) : string |
Get the S3 bucket name |
|
get_s3_bucket_region ( ) |
|
|
get_s3_url ( ) |
|
|
register_stream_wrapper ( ) |
Register the stream wrapper for s3 |
|
s3 ( ) : Aws\S3\S3Client |
|
|
setup ( ) |
Setup the hooks, urls filtering etc for S3 Uploads |
|
tear_down ( ) |
Tear down the hooks, url filtering etc for S3 Uploads |
|
wp_filter_delete_file ( string $file_path ) : string |
When WordPress removes files, it's expecting to do so on
absolute file paths, as such it breaks when using uris for
file paths (such as s3://. |
|
wp_filter_read_image_metadata ( array $meta, string $file ) : array | boolean |
Filters wp_read_image_metadata. exif_read_data() doesn't work on
file streams so we need to make a temporary local copy to extract
exif data from. |
|