duanke9540 2018-02-15 02:49
浏览 63
已采纳

在Wordpress中禁用多个插件更新

How can I use the below code in my wp-config to disable multiple plugins?

For example, this code will stop plugin.php from updating but how can I disable multiple in an array so that plugin.php, plugin1.php and plugin2.php are also disabled.

/* Function which remove Plugin Update Notices */
function disable_plugin_updates( $value ) {
   unset( $value->response['plugin/plugin.php'] );
   return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );
  • 写回答

1条回答 默认 最新

  • dscss8996 2018-02-15 03:03
    关注
    /* Function which remove Plugin Update Notices */
    function disable_plugin_updates( $values ) {
    
       foreach($values as $value) {
           unset( $value->response['plugin/plugin.php'] );
       }
       return;
    }
    add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?