wordpress

wordpress 指定插件 不检查更新

指定插件不提示更新

//指定插件不更新
add_filter('site_transient_update_plugins', 'remove_update_notification');
function remove_update_notification($value) {
    if(isset($value) && is_object($value)){
        $disable_update_plugin='learnpress/learnpress.php';
        if(isset($value->response[ $disable_update_plugin ])){
            unset($value->response[ $disable_update_plugin ]);
        }
    }
    return $value;
}

参考

https://gist.github.com/rniswonger/ee1b30e5fd3693bb5f92fbcfabe1654d
https://stackoverflow.com/questions/17897044/wordpress-how-to-disable-plugin-update
禁止所有插件更新 https://wordpress.org/plugins/disable-wordpress-updates/