Skip to content

Instantly share code, notes, and snippets.

View ivangrynenko's full-sized avatar

ivangrynenko ivangrynenko

View GitHub Profile
@ivangrynenko
ivangrynenko / site-config.php
Created March 13, 2023 07:08
Disabling plugin updates in Wordpress via Wordpress backend (UI) - hosted in Lagoon
// Add this to an "mu" plugin:
if (getenv('LAGOON_ENVIRONMENT') == 'production') {
// Disable ability to check for plugin updates.
add_filter( 'site_transient_update_plugins', 'mysite_remove_plugin_updates' );
}
/**
* Helper functions to disable plugin updates.
*/
function mysite_remove_plugin_updates( $value ) {
@ivangrynenko
ivangrynenko / quant-non-production.php
Created May 24, 2022 05:59
Quant override for non-production environments.
<?php
if (getenv('LAGOON_ENVIRONMENT_TYPE') !== 'production') {
/**
* Disable Quant in non-production environments.
* Applicable to Drupal 8 or 9.
*/
$config['quant.settings']['quant_enabled'] = 0;
$config['quant.settings']['quant_enabled_nodes'] = 0;
$config['quant.settings']['quant_enabled_taxonomy'] = 0;
@ivangrynenko
ivangrynenko / gist:a7171324527f7ca576d52c297197410c
Created May 24, 2022 05:54
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');