Created
December 7, 2017 12:27
-
-
Save IronGhost63/3f8b32cef79d7a4b91bdc41ab87c87cc to your computer and use it in GitHub Desktop.
lock version for specific plugin
This file contains 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
<?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