WordPress at Your Fingertips
function is not described

WC_Settings_API::generate_settings_html() public WC 1.0.0

Generate Settings HTML.

Generate the HTML for the fields on the "settings" screen.

{} It's a method of the class: WC_Settings_API{}

No Hooks.

Return

String. the html for the settings

Usage

$WC_Settings_API = new WC_Settings_API();
$WC_Settings_API->generate_settings_html( $form_fields, $echo );
$form_fields(array)
(default: array()) Array of form fields.
$echo(true|false)
Echo or return.

Changelog

Since 1.0.0 Introduced.

Code of WC_Settings_API::generate_settings_html() WC 5.5.2

<?php
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; // WPCS: XSS ok.
	} else {
		return $html;
	}
}