Commit 95f6e158 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Use S3-Upload as a Must-Use plugin

parent 5e8861ee
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -12,5 +12,10 @@
	},
	"config": {
		"gitlab-domains": [ "code.kodo.org.uk" ]
	},
	"extra": {
		"installer-paths": {
			"wp-content/mu-plugins/{$name}/": [ "type:wordpress-plugin" ]
		}
	}
}
+26 −0
Original line number Diff line number Diff line
<?php
/**
 * Plugin Name: S3-Uploads Configuration
 * Plugin URI: https://code.kodo.org.uk/singing-chimes.co.uk/wordpress/tree/master/plugins
 * Description: Filters S3-Uploads parameters to configure the plugin
 * Licence: MPL-2.0
 * Licence URI: https://www.mozilla.org/en-US/MPL/2.0/
 * Author: Dominik Sekotill
 * Author URI: https://code.kodo.org.uk/dom
 */
 * Plugin Name: S3-Uploads
 * Plugin URI: https://github.com/humanmade/S3-Uploads
 * Description: S3-Uploads with custom endpoint configuration
 * Licence: GPL-2.0+
 * Licence URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 * Author: Human Made Limited
 * Author URI: http://hmn.md/
 **/

if ( defined( 'S3_UPLOADS_ENTRYPOINT_URL' ) || defined( 'WP_CLI' ) ):

add_filter( 's3_uploads_s3_client_params', function ( $params ) {
	$params['endpoint'] = S3_UPLOADS_ENDPOINT_URL;
@@ -18,3 +20,7 @@ add_filter( 's3_uploads_s3_client_params', function ( $params ) {
	$params['region'] = '';
	return $params;
} );

require WPMU_PLUGIN_DIR . '/s3-uploads/s3-uploads.php';

endif;
+0 −2
Original line number Diff line number Diff line
@@ -106,8 +106,6 @@ setup_s3() {
	[[ -v S3_ENDPOINT_SECRET ]] ||
		return 0

	wp plugin activate s3-uploads

	[[ -v S3_UPLOADS_USE_LOCAL ]] &&
		wp config set S3_UPLOADS_USE_LOCAL true --raw