Skip to content

Instantly share code, notes, and snippets.

@spacedmonkey
Last active September 5, 2023 20:43
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save spacedmonkey/bdea0012b0cb25065cc1662956364df8 to your computer and use it in GitHub Desktop.
Using Digital Ocean spaces with S3 Uploads plugin
add_filter( 's3_uploads_s3_client_params', function ( $params ) {
if ( defined( 'S3_UPLOADS_ENDPOINT' ) ) {
$params['endpoint'] = S3_UPLOADS_ENDPOINT;
}
return $params;
}, 5, 1 );
define('S3_UPLOADS_BUCKET', <space_name>);
define('S3_UPLOADS_REGION', 'ams3');
define('S3_UPLOADS_KEY',<space_access_key>);
define('S3_UPLOADS_SECRET', <space_secret>);
define('S3_UPLOADS_BUCKET_URL', 'https://<space_name>.ams3.digitaloceanspaces.com');
define('S3_UPLOADS_ENDPOINT', 'ams3.digitaloceanspaces.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment