Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ivangrynenko/a7171324527f7ca576d52c297197410c to your computer and use it in GitHub Desktop.
Save ivangrynenko/a7171324527f7ca576d52c297197410c to your computer and use it in GitHub Desktop.
Quant local override for Wordpress
<?php
/**
* @file
*
* Overrides QuantCDN config for non production envs.
* Place this file to the mu-plugins folder, name it site-config.php
*/
if (empty(getenv('LAGOON_ENVIRONMENT')) || getenv('LAGOON_ENVIRONMENT') != 'production') {
add_filter('option_wp_quant_settings', 'override_wp_quant_settings');
function override_wp_quant_settings() {
$quant_settings = [
'enabled' => 0,
'webserver_url' => 'http://localhost',
'webserver_host' => 'www.example.com',
'api_endpoint' => 'https://api.quantcdn.io',
'api_account' => '',
'api_project' => '',
'api_token' => '',
];
return $quant_settings;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment