网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

在Wordpress中禁用多个插件更新

GG网络技术分享 2025-03-18 16:12 24


问题描述:

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\' );

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~

功能建议

如何在 wp-config </ code>中使用以下代码禁用多个插件? </ p>

例如,此代码将阻止plugin.php更新,但如何在数组</ code>中禁用多个,以便plugin.php,plugin1.php和plugin2 .php也被禁用。</ p>

  / *删除插件更新通知的功能* / 

function disable_plugin_updates($ value){

unset($ value-&gt; response [\' plugin / plugin.php\']);

返回$ value;

}

add_filter(\'site_transient_update_plugins\',\'disable_plugin_updates\');

</ code> </ pre>

</ div>

网友观点:

/* 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\' );

标签:

提交需求或反馈

Demand feedback