/** * Initialize Templatera with init action. */ function templatera_init() { // Display notice if Visual Composer is not installed or activated. if (!defined('WPB_VC_VERSION')) { add_action('admin_notices', 'templatera_notice'); return; } else { if (version_compare(WPB_VC_VERSION, WPB_VC_REQUIRED_VERSION) < 0) { add_action('admin_notices', 'templatera_notice_version'); return; } } if (!defined('WPB_VC_NEW_MENU_VERSION')) { define('WPB_VC_NEW_MENU_VERSION', (bool) (version_compare('4.5', WPB_VC_VERSION) <= 0)); } if (!defined('WPB_VC_NEW_USER_ACCESS_VERSION')) { define('WPB_VC_NEW_USER_ACCESS_VERSION', (bool) (version_compare('4.8', WPB_VC_VERSION) <= 0)); } if (WPB_VC_NEW_MENU_VERSION) { add_action('admin_head', 'wpb_templatera_menu_highlight'); add_action('vc_menu_page_build', 'wpb_templatera_add_submenu_page'); } add_filter('page_row_actions', 'wpb_templatera_render_row_action'); add_filter('post_row_actions', 'wpb_templatera_render_row_action'); $dir = dirname(__FILE__); // Init or use instance of the manager. global $vc_template_manager; $vc_template_manager = new VcTemplateManager($dir); $vc_template_manager->init(); }
/** * Initialize Templatera with init action. */ function templatera_init() { /* Display notice if Visual Composer is not installed or activated. */ if (!defined('WPB_VC_VERSION')) { add_action('admin_notices', 'templatera_notice'); return; } elseif (version_compare(WPB_VC_VERSION, WPB_VC_REQUIRED_VERSION) < 0) { add_action('admin_notices', 'templatera_notice_version'); return; } $dir = dirname(__FILE__); // Init or use instance of the manager. global $vc_template_manager; $vc_template_manager = new VcTemplateManager($dir); $vc_template_manager->init(); }