Loading inc/class-s3-uploads.php +9 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,6 @@ class S3_Uploads { public function __construct( $bucket, $key, $secret ) { add_filter( 'upload_dir', array( $this, 'filter_upload_dir' ) ); remove_filter( 'admin_notices', 'wpthumb_errors' ); $this->bucket = $bucket; $this->key = $key; $this->secret = $secret; Loading Loading @@ -73,4 +70,13 @@ class S3_Uploads { return $this->s3; } public function filter_editors( $editors ) { if ( ( $position = array_search( 'WP_Image_Editor_Imagick', $editors ) ) !== false ) { unset($editors[$position]); } return $editors; } } No newline at end of file s3-uploads.php +5 −10 Original line number Diff line number Diff line Loading @@ -15,14 +15,9 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { } add_action( 'plugins_loaded', function() { S3_Uploads::get_instance(); }); add_filter( 'wp_image_editors', function( $editors ) { $instance = S3_Uploads::get_instance(); if ( ( $position = array_search( 'WP_Image_Editor_Imagick', $editors ) ) !== false ) { unset($editors[$position]); } return $editors; }, 9 ); No newline at end of file add_filter( 'upload_dir', array( $instance, 'filter_upload_dir' ) ); add_filter( 'wp_image_editors', array( $instance, 'filter_editors' ), 9 ); remove_filter( 'admin_notices', 'wpthumb_errors' ); }); Loading
inc/class-s3-uploads.php +9 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,6 @@ class S3_Uploads { public function __construct( $bucket, $key, $secret ) { add_filter( 'upload_dir', array( $this, 'filter_upload_dir' ) ); remove_filter( 'admin_notices', 'wpthumb_errors' ); $this->bucket = $bucket; $this->key = $key; $this->secret = $secret; Loading Loading @@ -73,4 +70,13 @@ class S3_Uploads { return $this->s3; } public function filter_editors( $editors ) { if ( ( $position = array_search( 'WP_Image_Editor_Imagick', $editors ) ) !== false ) { unset($editors[$position]); } return $editors; } } No newline at end of file
s3-uploads.php +5 −10 Original line number Diff line number Diff line Loading @@ -15,14 +15,9 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { } add_action( 'plugins_loaded', function() { S3_Uploads::get_instance(); }); add_filter( 'wp_image_editors', function( $editors ) { $instance = S3_Uploads::get_instance(); if ( ( $position = array_search( 'WP_Image_Editor_Imagick', $editors ) ) !== false ) { unset($editors[$position]); } return $editors; }, 9 ); No newline at end of file add_filter( 'upload_dir', array( $instance, 'filter_upload_dir' ) ); add_filter( 'wp_image_editors', array( $instance, 'filter_editors' ), 9 ); remove_filter( 'admin_notices', 'wpthumb_errors' ); });