Created
March 13, 2023 07:08
-
-
Save ivangrynenko/b01be188c87fdd9088e5ebb50ca913ef to your computer and use it in GitHub Desktop.
Disabling plugin updates in Wordpress via Wordpress backend (UI) - hosted in Lagoon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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