Esempio n. 1
0
 /**
  * Set meta box id
  *
  * @param string|MetaBoxInterface $meta_box
  *
  * @return $this
  * @access pubic
  */
 public function setMetaBox($meta_box)
 {
     if ($meta_box instanceof MetaBoxInterface) {
         $this->meta_box = $meta_box;
         $meta_key = $meta_box->getId();
     } else {
         $meta_key = $meta_box;
     }
     $this->query_vars['meta_key'] = $meta_key;
     return $this;
 }
Esempio n. 2
0
 /**
  * Register meta box too Post Type
  *
  * @param MetaBoxInterface $meta_box
  *
  * @access public
  * @return void
  */
 public function registerMetaBox(MetaBoxInterface $meta_box)
 {
     try {
         $this->meta_box_handler = $meta_box;
         $meta_box->setId($this->name);
         $meta_box->addPostType($this->name);
     } catch (MetaBoxException $ex) {
         echo $ex->displayAdminNotice();
     }
 }