Skip to content

Instantly share code, notes, and snippets.

@ivangrynenko
Created March 13, 2023 07:08
Show Gist options
  • Save ivangrynenko/b01be188c87fdd9088e5ebb50ca913ef to your computer and use it in GitHub Desktop.
Save ivangrynenko/b01be188c87fdd9088e5ebb50ca913ef to your computer and use it in GitHub Desktop.
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 ) {
unset( $value->response['plugin/plugin-file.php'] );
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment