public/wordpress/wp-content/plugins/wp-courseware/includes/common/settings-api.php
/**
	 * Generate Fields HTML.
	 *
	 * Generate the HTML for the fields.
	 *
	 * @since 4.3.0
	 *
	 * @param array $fields The form fields.
	 * @param bool  $echo Should the fields html be echoed or returned.
	 *
	 * @return string The html string for the settings.
	 */
Generate Fields HTML.
Generate the HTML for the fields.



@param array $fields The form fields.
@param bool  $echo Should the fields html be echoed or returned.

@return string The html string for the settings.
Generate Fields HTML . Generate the HTML for the fields . @param array $fields The form fields . @param bool $echo Should the fields html be echoed or returned . @return string The html string for the settings .
public function generate_fields_html( $fields = array(), $echo = true ) {
		if ( empty( $fields ) ) {
			return;
		}
		$html = '';
		$fields = apply_filters( 'wpcw_settings_before_generate_fields_html', $fields, $this );
		foreach ( $fields as $id => $field ) {
			$type = $this->get_field_type( $field );
			$key = isset( $field['key'] ) ? $this->get_field_key( $field['key'] ) : '';
			if ( 'hidden' === $type || '' === $key ) {
				continue;
			}
			if ( ! isset( $field['wrapper'] ) || ( isset( $field['wrapper'] ) && $field['wrapper'] ) ) {
				$html .= $this->generate_field_row_start_html( $key, $field );
			}
			if ( method_exists( $this, 'generate_' . $type . '_field_html' ) ) {
				$html .= $this->{'generate_' . $type . '_field_html'}( $key, $field );
			} else {
				$html .= $this->generate_missing_field_type_html( $key, $field );
			}
			if ( ! isset( $field['wrapper'] ) || ( isset( $field['wrapper'] ) && $field['wrapper'] ) ) {
				$html .= $this->generate_field_row_end_html( $key, $field );
			}
		}
		if ( $echo ) {
			echo $html;
		} else {
			return $html;
		}
	}
public function generate_fields_html ( $ fields = array ( ) , $ echo = true ) { if ( empty ( $ fields ) ) { return ; } $ html = '' ; $ fields = apply_filters ( 'wpcw_settings_before_generate_fields_html' , $ fields , $ this ) ; foreach ( $ fields as $ id => $ field ) { $ type = $ this -> get_field_type ( $ field ) ; $ key = isset ( $ field [ 'key' ] ) ? $ this -> get_field_key ( $ field [ 'key' ] ) : '' ; if ( 'hidden' === $ type || '' === $ key ) { continue ; } if ( ! isset ( $ field [ 'wrapper' ] ) || ( isset ( $ field [ 'wrapper' ] ) && $ field [ 'wrapper' ] ) ) { $ html .= $ this -> generate_field_row_start_html ( $ key , $ field ) ; } if ( method_exists ( $ this , 'generate_' . $ type . '_field_html' ) ) { $ html .= $ this -> { 'generate_' . $ type . '_field_html' } ( $ key , $ field ) ; } else { $ html .= $ this -> generate_missing_field_type_html ( $ key , $ field ) ; } if ( ! isset ( $ field [ 'wrapper' ] ) || ( isset ( $ field [ 'wrapper' ] ) && $ field [ 'wrapper' ] ) ) { $ html .= $ this -> generate_field_row_end_html ( $ key , $ field ) ; } } if ( $ echo ) { echo $ html ; } else { return $ html ; } }
Generate Fields HTML.
Generate Fields HTML .
/**
		 * Filter: Before Generate Fields Html.
		 *
		 * @since 4.4.0
		 *
		 * @param array        $fields The fields array.
		 * @param Settings_Api $this The settings api object.
		 *
		 * @return array $fields The fields array.
		 */