src/properties/class-papi-property-term.php
public function html() {
		$settings          = $this->get_settings();
		$layout            = $settings->layout;
		$labels            = $this->get_labels();
		$taxonomies        = $this->get_taxonomies();
		$render_label      = count( $taxonomies ) > 1;
		$advanced          = $render_label && $layout === 'advanced';
		$single            = $render_label && $layout !== 'advanced';
		$classes           = count( $taxonomies ) > 1 ? '' : 'papi-fullwidth';
		$value             = $this->get_value();
		$selected_term     = get_term( $value );
		$selected_term     = is_wp_error( $selected_term ) || empty( $selected_term ) ? '' : $selected_term;
		$selected_taxonomy = empty( $selected_term ) ? reset( $taxonomies ) : $selected_term->taxonomy;
		$value             = $this->get_term_value( $value );
		$selected_label    = reset( $labels );

		if ( $settings->select2 ) {
			$classes = ' papi-component-select2';
		}

		?>

		<div class="papi-property-term <?php echo $advanced ? 'advanced' : ''; ?>">
			<?php if ( $advanced ): ?>
				<table class="papi-table">
					<tr>
						<td>
							<label for="<?php echo esc_attr( $this->html_id() ); ?>_taxonomy">
								<?php echo esc_html( $settings->labels['select_taxonomy'] ); ?>
							</label>
						</td>
						<td>
							<select
								id="<?php echo esc_attr( $this->html_id() ); ?>_taxonomy"
								class="<?php echo esc_attr( $classes ); ?> papi-property-term-left"
								data-select-item="<?php echo esc_attr( $settings->labels['select_item'] ); ?>"
								data-term-query='<?php echo esc_attr( papi_maybe_json_encode( $settings->query ) ); ?>'
								data-width="100%"
								>
								<?php
								foreach ( $labels as $taxonomy => $label ) {
									papi_render_html_tag( 'option', [
										'value'    => $taxonomy,
										'selected' => $taxonomy === $selected_taxonomy,
										$label
									] );

									if ( $selected ) {
										$selected_label = $label;
									}
								}
								?>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							<label for="<?php echo esc_attr( $this->html_id() ); ?>_terms">
								<?php echo esc_html( sprintf( $settings->labels['select_item'], $selected_label ) ); ?>
							</label>
						</td>
					<td>
			<?php endif; ?>

			<?php
				$placeholder = ! is_null( $settings->placeholder ) ? $settings->placeholder : '';
				$placeholder = papi_is_empty( $placeholder ) ? '&nbsp;' : $placeholder;
			?>

			<select
				class="<?php echo esc_attr( $classes ); ?>  papi-property-term-right"
				id="<?php echo esc_attr( $this->html_id() ); ?>_terms"
				name="<?php echo esc_attr( $this->html_name() ); ?>"
				class="<?php echo esc_attr( $classes ); ?>"
				data-allow-clear="<?php echo is_null( $settings->placeholder ) ? 'false' : 'true'; ?>"
				data-placeholder="<?php echo esc_attr( $placeholder ); ?>"
				data-width="100%">

				<?php if ( ! is_null( $settings->placeholder ) ): ?>
					<option value="<?php echo esc_attr( $this->get_option( 'default', ' ' ) ); ?>"><?php echo esc_html( $placeholder ); ?></option>
				<?php endif; ?>

				<?php foreach ( $taxonomies as $taxonomy ) : ?>
					<?php
					if ( $advanced && $taxonomy !== $selected_taxonomy ) {
						continue;
					}

					$terms = $this->get_terms( $taxonomy );
					if ( empty( $terms ) ) {
						continue;
					}
					?>

					<?php if ( $single ): ?>
						<optgroup label="<?php echo esc_attr( $labels[$taxonomy] ); ?>">
					<?php endif; ?>

					<?php
					foreach ( $terms as $term_id => $term_name ) {
						if ( papi_is_empty( $term_name ) ) {
							continue;
						}

						papi_render_html_tag( 'option', [
							'data-allow-clear' => $settings->allow_clear,
							'value'            => $this->get_term_value( $term_id ),
							'selected'         => $value === $this->get_term_value( $term_id ),
							esc_html( $term_name )
						] );
					}
					?>

					<?php if ( $single ): ?>
						</optgroup>
					<?php endif; ?>

				<?php endforeach; ?>
			</select>

			<?php if ( $advanced ): ?>
					</td>
				</tr>
			</table>
			<?php endif; ?>

		</div>
		<?php
	}
public function html() {
		$settings          = $this->get_settings();
		$layout            = $settings->layout;
		$labels            = $this->get_labels();
		$taxonomies        = $this->get_taxonomies();
		$render_label      = count( $taxonomies ) > 1;
		$advanced          = $render_label && $layout === 'advanced';
		$single            = $render_label && $layout !== 'advanced';
		$classes           = count( $taxonomies ) > 1 ? '' : 'papi-fullwidth';
		$value             = $this->get_value();
		$selected_term     = get_term( $value );
		$selected_term     = is_wp_error( $selected_term ) || empty( $selected_term ) ? '' : $selected_term;
		$selected_taxonomy = empty( $selected_term ) ? reset( $taxonomies ) : $selected_term->taxonomy;
		$value             = $this->get_term_value( $value );
		$selected_label    = reset( $labels );

		if ( $settings->select2 ) {
			$classes = ' papi-component-select2';
		}

		?>

		<div class="papi-property-term <?php echo $advanced ? 'advanced' : ''; ?>">
			<?php if ( $advanced ): ?>
				<table class="papi-table">
					<tr>
						<td>
							<label for="<?php echo esc_attr( $this->html_id() ); ?>_taxonomy">
								<?php echo esc_html( $settings->labels['select_taxonomy'] ); ?>
							</label>
						</td>
						<td>
							<select
								id="<?php echo esc_attr( $this->html_id() ); ?>_taxonomy"
								class="<?php echo esc_attr( $classes ); ?> papi-property-term-left"
								data-select-item="<?php echo esc_attr( $settings->labels['select_item'] ); ?>"
								data-term-query='<?php echo esc_attr( papi_maybe_json_encode( $settings->query ) ); ?>'
								data-width="100%"
								>
								<?php
								foreach ( $labels as $taxonomy => $label ) {
									papi_render_html_tag( 'option', [
										'value'    => $taxonomy,
										'selected' => $taxonomy === $selected_taxonomy,
										$label
									] );

									if ( $selected ) {
										$selected_label = $label;
									}
								}
								?>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							<label for="<?php echo esc_attr( $this->html_id() ); ?>_terms">
								<?php echo esc_html( sprintf( $settings->labels['select_item'], $selected_label ) ); ?>
							</label>
						</td>
					<td>
			<?php endif; ?>

			<?php
				$placeholder = ! is_null( $settings->placeholder ) ? $settings->placeholder : '';
				$placeholder = papi_is_empty( $placeholder ) ? '&nbsp;' : $placeholder;
			?>

			<select
				class="<?php echo esc_attr( $classes ); ?>  papi-property-term-right"
				id="<?php echo esc_attr( $this->html_id() ); ?>_terms"
				name="<?php echo esc_attr( $this->html_name() ); ?>"
				class="<?php echo esc_attr( $classes ); ?>"
				data-allow-clear="<?php echo is_null( $settings->placeholder ) ? 'false' : 'true'; ?>"
				data-placeholder="<?php echo esc_attr( $placeholder ); ?>"
				data-width="100%">

				<?php if ( ! is_null( $settings->placeholder ) ): ?>
					<option value="<?php echo esc_attr( $this->get_option( 'default', ' ' ) ); ?>"><?php echo esc_html( $placeholder ); ?></option>
				<?php endif; ?>

				<?php foreach ( $taxonomies as $taxonomy ) : ?>
					<?php
					if ( $advanced && $taxonomy !== $selected_taxonomy ) {
						continue;
					}

					$terms = $this->get_terms( $taxonomy );
					if ( empty( $terms ) ) {
						continue;
					}
					?>

					<?php if ( $single ): ?>
						<optgroup label="<?php echo esc_attr( $labels[$taxonomy] ); ?>">
					<?php endif; ?>

					<?php
					foreach ( $terms as $term_id => $term_name ) {
						if ( papi_is_empty( $term_name ) ) {
							continue;
						}

						papi_render_html_tag( 'option', [
							'data-allow-clear' => $settings->allow_clear,
							'value'            => $this->get_term_value( $term_id ),
							'selected'         => $value === $this->get_term_value( $term_id ),
							esc_html( $term_name )
						] );
					}
					?>

					<?php if ( $single ): ?>
						</optgroup>
					<?php endif; ?>

				<?php endforeach; ?>
			</select>

			<?php if ( $advanced ): ?>
					</td>
				</tr>
			</table>
			<?php endif; ?>

		</div>
		<?php
	}
Render property html.