/** * Visual Composer manager. * @since 4.2 * @return Vc_Manager */ function vc_manager() { return Vc_Manager::getInstance(); }
public function setPluginName($name) { $this->plugin_name = $name; } /** * Get absolute url for VC asset file. * * Assets are css, javascript, less files and images. * * @since 4.2 * * @param $file * * @return string */ public function assetUrl($file) { return preg_replace('/\\s/', '%20', plugins_url($this->path('ASSETS_DIR_NAME', $file), __FILE__)); } } /** * Main Visual composer manager. * @var Vc_Manager $vc_manager - instance of composer management. * @since 4.2 */ global $vc_manager; if (!$vc_manager) { $vc_manager = Vc_Manager::getInstance(); // Load components $vc_manager->loadComponents(); }
public function vc_post($post_id = false) { $vc_post_ids = get_transient('import_vc_posts'); if (!is_array($vc_post_ids)) { $vc_post_ids = array(); } if ($post_id) { $vc_post_ids[$post_id] = $post_id; set_transient('import_vc_posts', $vc_post_ids, 60 * 60 * 24); } else { $this->log('Processing vc pages 2: '); return; if (class_exists('Vc_Manager') && class_exists('Vc_Post_Admin')) { $this->log($vc_post_ids); $vc_manager = Vc_Manager::getInstance(); $vc_base = $vc_manager->vc(); $post_admin = new Vc_Post_Admin(); foreach ($vc_post_ids as $vc_post_id) { $this->log('Save ' . $vc_post_id); $vc_base->buildShortcodesCustomCss($vc_post_id); $post_admin->save($vc_post_id); $post_admin->setSettings($vc_post_id); //twice? bug? $vc_base->buildShortcodesCustomCss($vc_post_id); $post_admin->save($vc_post_id); $post_admin->setSettings($vc_post_id); } } } }