/** * Get template content for frontend. * @deprecated since 4.4 we use VcTemplateManager::renderBackendTemplate and VcTemplateManager::renderFrontendTemplate */ public function loadInline() { $post = !empty($_POST['template_id']) ? get_post($_POST['template_id']) : false; if (!$post || $post->post_type !== self::$post_type) { die; } set_vc_is_inline(); vc_frontend_editor()->enqueueRequired(); vc_frontend_editor()->setTemplateContent($post->post_content); vc_frontend_editor()->render('template'); die; }
/** * Used to render template for frontend * @since 4.4 * * @param $template_id * @param $template_type * * @return string|int */ public function renderFrontendTemplate($template_id, $template_type) { if ($template_type == 'templatera_templates') { // do something to return output of templatera template $post = get_post($template_id); if ($post->post_type == self::$post_type) { set_vc_is_inline(); // todo make sure we need this? vc_frontend_editor()->enqueueRequired(); vc_frontend_editor()->setTemplateContent($post->post_content); vc_frontend_editor()->render('template'); die; } } return $template_id; }