Skip to content

Instantly share code, notes, and snippets.

@wpscholar
Created May 19, 2020 17:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpscholar/b4747d39bc9ad9f9cbef2bbdaae0c867 to your computer and use it in GitHub Desktop.
Save wpscholar/b4747d39bc9ad9f9cbef2bbdaae0c867 to your computer and use it in GitHub Desktop.
A WordPress MU plugin that can prevent plugin updates for specific plugins.
<?php
add_filter(
'site_transient_update_plugins',
function ( $transient ) {
$plugins = array(
'wordpress-seo/wp-seo.php',
);
foreach ( $plugins as $plugin ) {
if ( isset( $transient->response[ $plugin ] ) ) {
$transient->no_update[ $plugin ] = $transient->response[ $plugin ];
unset( $transient->response[ $plugin ] );
}
}
return $transient;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment