/**
  * 
  * init slide by post data
  */
 public function initByPostData($postData, RevSlide $slideTemplate, $sliderID)
 {
     $this->postData = $this->postData;
     $postID = $postData["ID"];
     $arrWildcardsValues = RevOperations::getPostWilcardValues($postID);
     $slideTemplateID = UniteFunctionsRev::getVal($arrWildcardsValues, "slide_template");
     if (!empty($slideTemplateID) && is_numeric($slideTemplateID)) {
         //init by local template, if fail, init by global (slider) template
         try {
             $slideTemplateLocal = new RevSlide();
             $slideTemplateLocal->initByID($slideTemplateID);
             $this->initBySlide($slideTemplateLocal);
         } catch (Exception $e) {
             $this->initBySlide($slideTemplate);
         }
     } else {
         //init by global template
         $this->initBySlide($slideTemplate);
     }
     //set some slide params
     $this->id = $postID;
     $this->params["title"] = UniteFunctionsRev::getVal($postData, "post_title");
     if ($this->params['enable_link'] == "true" && $this->params['link_type'] == "regular") {
         $link = get_permalink($postID);
         $this->params["link"] = str_replace("%link%", $link, $this->params["link"]);
         $this->params["link"] = str_replace('-', '_REVSLIDER_', $this->params["link"]);
         //process meta tags:
         $arrMatches = array();
         preg_match('/%meta:\\w+%/', $this->params["link"], $arrMatches);
         foreach ($arrMatches as $match) {
             $meta = str_replace("%meta:", "", $match);
             $meta = str_replace("%", "", $meta);
             $meta = str_replace('_REVSLIDER_', '-', $meta);
             $metaValue = get_post_meta($postID, $meta, true);
             $this->params["link"] = str_replace($match, $metaValue, $this->params["link"]);
         }
         $this->params["link"] = str_replace('_REVSLIDER_', '-', $this->params["link"]);
     }
     $status = $postData["post_status"];
     if ($status == "publish") {
         $this->params["state"] = "published";
     } else {
         $this->params["state"] = "unpublished";
     }
     //set image
     $thumbID = UniteFunctionsWPRev::getPostThumbID($postID);
     if (!empty($thumbID)) {
         $this->setImageByImageID($thumbID);
     }
     //replace placeholders in layers:
     $this->setLayersByPostData($postData, $sliderID);
 }