src/properties/class-papi-property-post.php
public function html() {
		$settings           = $this->get_settings();
		$layout             = $settings->layout;
		$labels             = $this->get_labels();
		$post_types         = $this->get_post_types();
		$render_label       = count( $post_types ) > 1;
		$advanced           = $render_label && $layout === 'advanced';
		$single             = $render_label && $layout !== 'advanced';
		$classes            = count( $post_types ) > 1 ? '' : 'papi-fullwidth';
		$value              = $this->get_value();
		$value              = $this->get_post_value( $value );
		$selected_label     = is_array( $labels ) && ! empty( $labels ) ? array_values( $labels )[0] : '';
		$selected_post_type = empty( $value ) ? '' : get_post_type( $value );
		$selected_post_type = empty( $selected_post_type ) ? '' : $selected_post_type;
		$posts              = $this->get_posts( $selected_post_type );

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

		// When new url is true and we have more than one post type
		// we need to use the advanced layout so the placeholder option
		// will get the right post type in the new url.
		if ( $settings->new_url && $render_label ) {
			$advanced = true;
			$single = false;
		}
		?>

		<div class="papi-property-post <?php echo $advanced ? 'advanced' : ''; ?>">
			<?php if ( $advanced ): ?>
			<table class="papi-table">
				<tr>
					<td>
						<label for="<?php echo esc_attr( $this->html_id() ); ?>_post_type">
							<?php echo esc_html( $settings->labels['select_post_type'] ); ?>
						</label>
					</td>
					<td>
						<select
							id="<?php echo esc_attr( $this->html_id() ); ?>_post_type"
							class="<?php echo esc_attr( $classes ); ?> papi-property-post-left"
							data-select-item="<?php echo esc_attr( $settings->labels['select_item'] ); ?>"
							data-post-query='<?php echo esc_attr( papi_maybe_json_encode( $settings->query ) ); ?>'
							data-width="100%"
						>
							<?php
							foreach ( $labels as $post_type => $label ) {
								$selected = $post_type === $selected_post_type;

								papi_render_html_tag( 'option', [
									'value'    => $post_type,
									'selected' => $selected,
									$label
								] );

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

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

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

							<?php if ( ! empty( $settings->placeholder ) ): ?>
								<?php if ( $settings->new_url ): ?>
									<option data-placeholder data-new-url="<?php echo esc_attr( admin_url( 'post-new.php?post_type=' . $post_types[0] ) ); ?>"></option>
								<?php else: ?>
									<option></option>
								<?php endif; ?>
							<?php endif; ?>

							<?php foreach ( $posts as $label => $items ) : ?>

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

								<?php
								foreach ( $items as $post ) {
									if ( papi_is_empty( $post->post_title ) ) {
										continue;
									}

									papi_render_html_tag( 'option', [
										'data-allow-clear' => $settings->allow_clear,
										'data-edit-url'    => $settings->edit_url ? get_edit_post_link( $post ) : '',
										'data-new-url'     => $settings->new_url ? admin_url( 'post-new.php?post_type=' . $post->post_type ) : '',
										'selected'         => $value === $this->get_post_value( $post ),
										'value'            => $this->get_post_value( $post ),
										$post->post_title
									] );
								}
								?>

								<?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();
		$post_types         = $this->get_post_types();
		$render_label       = count( $post_types ) > 1;
		$advanced           = $render_label && $layout === 'advanced';
		$single             = $render_label && $layout !== 'advanced';
		$classes            = count( $post_types ) > 1 ? '' : 'papi-fullwidth';
		$value              = $this->get_value();
		$value              = $this->get_post_value( $value );
		$selected_label     = is_array( $labels ) && ! empty( $labels ) ? array_values( $labels )[0] : '';
		$selected_post_type = empty( $value ) ? '' : get_post_type( $value );
		$selected_post_type = empty( $selected_post_type ) ? '' : $selected_post_type;
		$posts              = $this->get_posts( $selected_post_type );

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

		// When new url is true and we have more than one post type
		// we need to use the advanced layout so the placeholder option
		// will get the right post type in the new url.
		if ( $settings->new_url && $render_label ) {
			$advanced = true;
			$single = false;
		}
		?>

		<div class="papi-property-post <?php echo $advanced ? 'advanced' : ''; ?>">
			<?php if ( $advanced ): ?>
			<table class="papi-table">
				<tr>
					<td>
						<label for="<?php echo esc_attr( $this->html_id() ); ?>_post_type">
							<?php echo esc_html( $settings->labels['select_post_type'] ); ?>
						</label>
					</td>
					<td>
						<select
							id="<?php echo esc_attr( $this->html_id() ); ?>_post_type"
							class="<?php echo esc_attr( $classes ); ?> papi-property-post-left"
							data-select-item="<?php echo esc_attr( $settings->labels['select_item'] ); ?>"
							data-post-query='<?php echo esc_attr( papi_maybe_json_encode( $settings->query ) ); ?>'
							data-width="100%"
						>
							<?php
							foreach ( $labels as $post_type => $label ) {
								$selected = $post_type === $selected_post_type;

								papi_render_html_tag( 'option', [
									'value'    => $post_type,
									'selected' => $selected,
									$label
								] );

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

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

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

							<?php if ( ! empty( $settings->placeholder ) ): ?>
								<?php if ( $settings->new_url ): ?>
									<option data-placeholder data-new-url="<?php echo esc_attr( admin_url( 'post-new.php?post_type=' . $post_types[0] ) ); ?>"></option>
								<?php else: ?>
									<option></option>
								<?php endif; ?>
							<?php endif; ?>

							<?php foreach ( $posts as $label => $items ) : ?>

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

								<?php
								foreach ( $items as $post ) {
									if ( papi_is_empty( $post->post_title ) ) {
										continue;
									}

									papi_render_html_tag( 'option', [
										'data-allow-clear' => $settings->allow_clear,
										'data-edit-url'    => $settings->edit_url ? get_edit_post_link( $post ) : '',
										'data-new-url'     => $settings->new_url ? admin_url( 'post-new.php?post_type=' . $post->post_type ) : '',
										'selected'         => $value === $this->get_post_value( $post ),
										'value'            => $this->get_post_value( $post ),
										$post->post_title
									] );
								}
								?>

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

							<?php endforeach; ?>
						</select>

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

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