禁用Visual Composer的更新授权购买关闭提示

经常打开WordPress的仪表盘以及在其他界面编辑的时候会出现:
“Hola! Would you like to receive automatic updates and unlock premium support? Please activate your copy of Visual Composer.”
解决办法,将下面的代码复制并存为Stop_Visual_Composer_ActivationNag.php(建议存为UTF-8编码)文件上传到/wp-content/plugins/目录:

<?php
/*
Plugin Name: Stop Visual Composer Activation Nag
Plugin URI:
Description:
Version: 1.0
Author: Updated by JuPress.com
Author URI: http://jupress.com
License: GPL2
*/

/**如果需要禁用Visual Composer Ultimate Addons提示,将下面的两行代码添加到wp-config.php文件:
define('ULTIMATE_NO_EDIT_PAGE_NOTICE', true);
define('ULTIMATE_NO_PLUGIN_PAGE_NOTICE', true);
*/

add_action('admin_init', function()
{
if(is_admin()) {
setcookie('vchideactivationmsg', '1', strtotime('+3 years'), '/');
setcookie('vchideactivationmsg_vc11', (defined('WPB_VC_VERSION') ? WPB_VC_VERSION : '1'), strtotime('+3 years'), '/');
}
});

然后回到后台-插件进行启用即可。