WC_Settings_API::generate_settings_html PHP Method

generate_settings_html() public method

Generate the HTML for the fields on the "settings" screen.
Since: 1.0.0
public generate_settings_html ( array $form_fields = [], $echo = true ) : string
$form_fields array (default: array())
return string the html for the settings
    public function generate_settings_html($form_fields = array(), $echo = true)
    {
        if (empty($form_fields)) {
            $form_fields = $this->get_form_fields();
        }
        $html = '';
        foreach ($form_fields as $k => $v) {
            $type = $this->get_field_type($v);
            if (method_exists($this, 'generate_' . $type . '_html')) {
                $html .= $this->{'generate_' . $type . '_html'}($k, $v);
            } else {
                $html .= $this->generate_text_html($k, $v);
            }
        }
        if ($echo) {
            echo $html;
        } else {
            return $html;
        }
    }