WordPress
为防止为客户修改制作的主题和插件升级,我们需要禁用插件和主题更新。
禁用所有插件和主题更新
将以下代码添加到您的配置文件 wp-config.php 中:
- define(\’DISALLOW_FILE_MODS\’,true);
添加完成后,用户只能通过FTP来更新插件和主题。
禁用特定插件更新
把下面这段代码添加到你的当前主题 functions.php 文件中:
- filter_plugin_updates( ) {
- unset( ->response[\’plugin-directory/plugin-file.php\’] );
- ;
- }
- add_filter( \’site_transient_update_plugins\’, \’filter_plugin_updates\’ );
替换其中的 plugin-directory / plugin-file.php 为你的插件的目录和文件名。
原文:http://www.trickspanda.com/
暂无评论内容