/**
  * Visual Composer manager.
  * @since 4.2
  * @return Vc_Manager
  */
 function vc_manager()
 {
     return Vc_Manager::getInstance();
 }
Beispiel #2
0
 /**
  * Get the instane of VC_Manager
  *
  * @return self
  */
 public static function getInstance()
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 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);
             }
         }
     }
 }