MetaBox::generate_field( $fields = array() )


Source

File: classes/MetaBox.php

	public function generate_field( $fields = array() ) {
		if ( dozent_count( $fields ) ) {
			foreach ( $fields as $field_key => $field ) {
				$type = dozent_array_get( 'type', $field );
				?>
				<div class="dozent-option-field-wrap dozent-field-row-<?php echo $type; ?>">
					<?php
					if ( isset( $field['title'] ) ) {
						?>
						<div class="dozent-option-field-title">
							<label for="">
								<strong><?php echo $field['title']; ?></strong>
							</label>
						</div>
						<?php
					}
					?>
					<div class="dozent-option-field flex-grow-1 dozent-field-<?php echo $type; ?>">
						<?php
						$field['field_key'] = $field_key;
						$this->field_type( $field );
						if ( isset( $field['desc'] ) ) {
							echo "<p class='desc dozent-text-muted'>{$field['desc']}</p>";
						}
						?>
					</div>
				</div>
				<?php
			}
		}
	}