Skip to content

Instantly share code, notes, and snippets.

@IronGhost63
Created December 7, 2017 12:27
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 IronGhost63/3f8b32cef79d7a4b91bdc41ab87c87cc to your computer and use it in GitHub Desktop.
Save IronGhost63/3f8b32cef79d7a4b91bdc41ab87c87cc to your computer and use it in GitHub Desktop.
lock version for specific plugin
<?php
function wp63_lock_plugin_version($data){
$lock = apply_filters( "wp63_lock_plugin_version", array() );
if(isset( $data->response )){
foreach( $data->response as $key => $value ){
if( isset($lock[$value->slug]) && $value->new_version != $lock[$value->slug]){
$data->no_update[] = $value;
unset($data->response[$key]);
}
}
}
return $data;
}
add_filter( "pre_set_site_transient_update_plugins", "wp63_lock_plugin_version" );
// How to Use:
add_filter( "wp63_lock_plugin_version", function($data){
return array(
'jetpack' => "5.5.1"
);
} );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment