示例#1
0
 /**
  * Description Set & Get
  * @param $description
  */
 public function set_description($description)
 {
     if (!is_array($description)) {
         $this->description = array(array('type' => 'paragraph', 'content' => $description));
         return;
     }
     // @todo Remove once placeholder replace comes before Twig rendering
     foreach ($description as &$element) {
         if (isset($element['target'])) {
             switch ($element['target']) {
                 case '%POST-PERMALINK%':
                     $element['target'] = Types_Helper_Placeholder::get_permalink();
                     break;
                 case '%POST-ARCHIVE-PERMALINK%':
                     $element['target'] = Types_Helper_Placeholder::get_archive_permalink();
                     break;
             }
         }
     }
     $this->description = $description;
 }