/** * Visual Composer stores custom css as postmeta. * We need to check if current post has content_template and if so apply the custom css. * Hooked to the_content * * @param $content * @return mixed */ public function render_custom_css($content) { if (method_exists('Vc_Base', 'addPageCustomCss') && method_exists('Vc_Base', 'addShortcodesCustomCss')) { $content_template = get_post_meta(get_the_ID(), '_views_template', true); if ($content_template && !isset($this->log_rendered_css[$content_template])) { $vcbase = new Vc_Base(); $vcbase->addPageCustomCss($content_template); $vcbase->addShortcodesCustomCss($content_template); $this->log_rendered_css[$content_template] = true; } } return $content; }
/** * Visual Composer. * * @since 4.2 * @access public * * @return Vc_Base */ public function vc() { if (!isset($this->factory['vc'])) { do_action('vc_before_init_vc'); require_once $this->path('CORE_DIR', 'class-vc-base.php'); $vc = new Vc_Base(); // DI Set template new modal editor. require_once $this->path('EDITORS_DIR', 'popups/class-vc-templates-panel-editor.php'); $vc->setTemplatesPanelEditor(new Vc_Templates_Panel_Editor()); // DI Set edit form require_once $this->path('EDITORS_DIR', 'popups/class-vc-shortcode-edit-form.php'); $vc->setEditForm(new Vc_Shortcode_Edit_Form()); $this->factory['vc'] = $vc; do_action('vc_after_init_vc'); } return $this->factory['vc']; }
/** * Visual Composer. * * @since 4.2 * @access public * @return Vc_Base */ public function vc() { if (!isset($this->factory['vc'])) { do_action('vc_before_init_vc'); require_once $this->path('CORE_DIR', 'class-vc-base.php'); $vc = new Vc_Base(); // DI Set template editor. require_once $this->path('EDITORS_DIR', 'popups/class-vc-templates-editor.php'); $vc->setTemplatesEditor(new Vc_Templates_Editor()); // DI Set edit form require_once $this->path('EDITORS_DIR', 'popups/class-vc-shortcode-edit-form.php'); $vc->setEditForm(new Vc_Shortcode_Edit_Form()); // DI for third-party plugins manager. require_once $this->path('VENDORS_DIR', 'class-vc-vendors-manager.php'); $vc->setVendorsManager(new Vc_Vendors_Manager()); $this->factory['vc'] = $vc; do_action('vc_after_init_vc'); } return $this->factory['vc']; }