/** * 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); }
/** * 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); } } }