Disallow offload to s3 bucket
-
Hi,
I want to disallow all types of media to s3 bucket for temporally.
I’ve followed this page https://wordpress.org/support/topic/prevent-upload-to-s3/
to disallow images offloaded to s3 bucket.
But it seems not work,images still had been offloaded to s3 bucket.
Because I want to disallow all kind of media,so I try to add as many media types as I can think of.Here is my code:
function pre_update_attachment_metadata( $abort, $data, $post_id, $old_as3cf_item ) { $file = get_post_meta( $post_id, '_wp_attached_file', true ); $extension = is_string( $file ) ? pathinfo( $file, PATHINFO_EXTENSION ) : false; if ( is_string( $extension ) && in_array( $extension, array( 'mp4', 'mov', 'jpg', 'jpeg', 'png', 'pdf', 'psd', 'ai', 'cdr' ) ) ) { $abort = true; // abort the upload } return $abort; }I use “Code Snippet plugin” to add those code and run snippet everywhere, I have no idea what I did wrong.
Please help me.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘Disallow offload to s3 bucket’ is closed to new replies.