Exemplo n.º 1
0
 /**
  * Render metafield
  *
  * @param $type
  * @param null $vars
  */
 public static function field_render($type, $vars = NULL)
 {
     return Yonk_Util::renderPhpToString(YONK_PATH . 'meta/' . $type . '.php', $vars);
 }
Exemplo n.º 2
0
 /**
  * Add MetaBox CallBack
  *
  * @param $post
  */
 public function add_meta_box_callback($post)
 {
     wp_nonce_field($this->options['name'] . '_data', $this->options['name'] . '_nonce');
     echo '<p>' . $this->options['description'] . '</p>';
     if (strlen($this->options['template']) == 0) {
         $this->generate_fields($post);
     } else {
         $ff = file_exists(YONK_PATH . 'templates/' . $this->options['template']);
         if ($ff == TRUE) {
             echo Yonk_Util::renderPhpToString(YONK_PATH . 'templates/' . $this->options['template'], $this->options);
         } else {
             echo Yonk_Util::renderPhpToString($this->options['template'], $this->options);
         }
     }
 }