WC_Settings_API::generate_settings_html()
Generate Settings HTML.
Generate the HTML for the fields on the "settings" screen.
{} Это метод класса: WC_Settings_API{}
Хуков нет.
Возвращает
Строку
. the html for the settings
Использование
$WC_Settings_API = new WC_Settings_API(); $WC_Settings_API->generate_settings_html( $form_fields, $echo );
- $form_fields(массив)
- (default: array()) Array of form fields.
По умолчанию: array() - $echo(true|false)
- Echo or return.
По умолчанию: true
Список изменений
С версии 1.0.0 | Введена. |
Код WC_Settings_API::generate_settings_html() WC Settings API::generate settings html WC 6.4.1
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; } }