public function display() { global $post; $meta = $this->values; if (!$meta && !$this->args['repeatable']) { $meta = array(''); } $field = $this->args; foreach ($meta as $value) { $this->value = $value; echo '<div class="field-item">'; $this->html(); echo '</div>'; ?> <?php } if ($this->args['repeatable']) { $this->value = ''; echo '<div class="field-item hidden">'; $this->html(); echo '</div>'; ?> <p> <a href="#" class="button repeat-field">Add New</a> </p> <?php } if (!self::$added_js) { ?> <script type="text/javascript"> </script> <?php self::$added_js = true; } }