src/properties/class-papi-property-dropdown.php
public function html() {
		// Setup variables needed.
		$settings     = $this->get_settings();
		$value        = $this->get_value();
		$options_html = [];

		// Properties that extends dropdown property
		// maybe don't have this setting.
		if ( ! isset( $settings->selected ) ) {
			$settings->selected = [];
		}

		// Properties that extends dropdown property
		// maybe don't have this setting.
		if ( ! isset( $settings->multiple ) ) {
			$settings->multiple = false;
		}

		// Override selected setting with
		// database value if not empty.
		if ( ! papi_is_empty( $value ) ) {
			$settings->selected = $value;
		}

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

		// Add placeholder if any.
		if ( ! is_null( $settings->placeholder ) ) {
			$options_html[] = sprintf( '<option value="%s">%s</option>', esc_attr( $this->get_option( 'default', '' ) ), esc_html( $placeholder ) );
		}

		$classes = 'papi-fullwidth';

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

		// Create option html tags for all items.
		foreach ( $this->get_items() as $key => $value ) {
			$key = is_numeric( $key ) ? $value : $key;

			if ( papi_is_empty( $key ) ) {
				continue;
			}

			// When a multiple we need to check with
			// `in_array` since the value is a array.
			if ( $settings->multiple ) {
				$selected = in_array( $value, $settings->selected, true );
			} else {
				$selected = papi_convert_to_string( $value ) === papi_convert_to_string( $settings->selected );
			}

			$options_html[] = papi_html_tag( 'option', [
				'data-edit-url' => false,
				'data-new-url'  => false,
				'selected'      => $selected ? 'selected' : null,
				'value'         => $value,
				esc_html( papi_convert_to_string( $key ) )
			] );
		}

		// When selectize is empty this will be used.
		papi_render_html_tag( 'input', [
			'name' => $this->html_name() . ( $settings->multiple ? '[]' : '' ),
			'type' => 'hidden'
		] );

		papi_render_html_tag( 'select', [
			'class'            => $classes,
			'data-allow-clear' => $settings->allow_clear,
			'data-placeholder' => $placeholder,
			'data-width'       => '100%',
			'id'               => $this->html_id() . ( $settings->multiple ? '[]' : '' ),
			'multiple'         => $settings->multiple ? 'multiple' : null,
			'name'             => $this->html_name() . ( $settings->multiple ? '[]' : '' ),
			$options_html
		] );
	}
public function html() {
		// Setup variables needed.
		$settings     = $this->get_settings();
		$value        = $this->get_value();
		$options_html = [];

		// Properties that extends dropdown property
		// maybe don't have this setting.
		if ( ! isset( $settings->selected ) ) {
			$settings->selected = [];
		}

		// Properties that extends dropdown property
		// maybe don't have this setting.
		if ( ! isset( $settings->multiple ) ) {
			$settings->multiple = false;
		}

		// Override selected setting with
		// database value if not empty.
		if ( ! papi_is_empty( $value ) ) {
			$settings->selected = $value;
		}

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

		// Add placeholder if any.
		if ( ! is_null( $settings->placeholder ) ) {
			$options_html[] = sprintf( '<option value="%s">%s</option>', esc_attr( $this->get_option( 'default', '' ) ), esc_html( $placeholder ) );
		}

		$classes = 'papi-fullwidth';

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

		// Create option html tags for all items.
		foreach ( $this->get_items() as $key => $value ) {
			$key = is_numeric( $key ) ? $value : $key;

			if ( papi_is_empty( $key ) ) {
				continue;
			}

			// When a multiple we need to check with
			// `in_array` since the value is a array.
			if ( $settings->multiple ) {
				$selected = in_array( $value, $settings->selected, true );
			} else {
				$selected = papi_convert_to_string( $value ) === papi_convert_to_string( $settings->selected );
			}

			$options_html[] = papi_html_tag( 'option', [
				'data-edit-url' => false,
				'data-new-url'  => false,
				'selected'      => $selected ? 'selected' : null,
				'value'         => $value,
				esc_html( papi_convert_to_string( $key ) )
			] );
		}

		// When selectize is empty this will be used.
		papi_render_html_tag( 'input', [
			'name' => $this->html_name() . ( $settings->multiple ? '[]' : '' ),
			'type' => 'hidden'
		] );

		papi_render_html_tag( 'select', [
			'class'            => $classes,
			'data-allow-clear' => $settings->allow_clear,
			'data-placeholder' => $placeholder,
			'data-width'       => '100%',
			'id'               => $this->html_id() . ( $settings->multiple ? '[]' : '' ),
			'multiple'         => $settings->multiple ? 'multiple' : null,
			'name'             => $this->html_name() . ( $settings->multiple ? '[]' : '' ),
			$options_html
		] );
	}
Render property html.