Fieldmanager_Field::add_another PHP Method

add_another() public method

Generates HTML for the "Add Another" button.
public add_another ( ) : string
return string button HTML.
    public function add_another()
    {
        $classes = array('fm-add-another', 'fm-' . $this->name . '-add-another', 'button-secondary');
        if (empty($this->add_more_label)) {
            $this->add_more_label = $this->is_group() ? __('Add group', 'fieldmanager') : __('Add field', 'fieldmanager');
        }
        $out = '<div class="fm-add-another-wrapper">';
        $out .= sprintf('<input type="button" class="%s" value="%s" name="%s" data-related-element="%s" data-add-more-position="%s" data-limit="%d" />', esc_attr(implode(' ', $classes)), esc_attr($this->add_more_label), esc_attr('fm_add_another_' . $this->name), esc_attr($this->name), esc_attr($this->add_more_position), intval($this->limit));
        $out .= '</div>';
        return $out;
    }