/** * 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(); }
/** * Highlight Vc submenu * * @since 1.2 */ function wpb_templatera_menu_highlight() { global $parent_file, $submenu_file, $post_type; if ($post_type === VcTemplateManager::postType() && (!defined('VC_IS_TEMPLATE_PREVIEW') || !VC_IS_TEMPLATE_PREVIEW)) { $parent_file = VC_PAGE_MAIN_SLUG; $submenu_file = 'edit.php?post_type=' . rawurlencode(VcTemplateManager::postType()); } }
/** * Highlight Vc submenu * * @since 1.2 */ function wpb_templatera_menu_highlight() { global $parent_file, $submenu_file, $post_type; if ($post_type === VcTemplateManager::postType()) { $parent_file = VC_PAGE_MAIN_SLUG; $submenu_file = 'edit.php?post_type=' . rawurlencode(VcTemplateManager::postType()); } }