src/properties/class-papi-property-file.php
public function html() {
		$css_classes = '';
		$labels      = $this->get_labels();
		$settings    = $this->get_settings();
		$slug        = $this->html_name();
		$value       = papi_to_array( $this->get_value() );

		// Keep only valid objects.
		$value = array_filter( $value, function ( $item ) {
			return is_object( $item ) && isset( $item->id ) && ! empty( $item->id );
		} );

		$show_button = empty( $value );

		if ( $settings->multiple ) {
			$css_classes .= ' multiple ';
			$slug .= '[]';
			$show_button = true;
		}
		?>

		<div class="papi-property-file <?php echo esc_attr( $css_classes ); ?>" data-file-type="<?php echo esc_attr( $this->file_type ); ?>">
			<p class="papi-file-select <?php echo $show_button ? '' : 'papi-hide'; ?>">
				<?php
				if ( ! $settings->multiple ) {
					echo esc_html( $labels['no_file'] ) . '&nbsp;';
				}

				papi_render_html_tag( 'input', [
					'name'  => esc_attr( $slug ),
					'type'  => 'hidden',
					'value' => ''
				] );

				papi_render_html_tag( 'button', [
					'data-slug' => esc_attr( $slug ),
					'class'     => 'button',
					'type'      => 'button',

					esc_html( $labels['add'] )
				] );
				?>
			</p>
			<div class="attachments">
				<?php
				if ( is_array( $value ) ):
					foreach ( $value as $file ):
						if ( ! is_object( $file ) ) {
							continue;
						}

						$url = wp_get_attachment_thumb_url( $file->id );

						if ( empty( $url ) ) {
							$url = wp_mime_type_icon( $file->id );
						}
						?>
						<div class="attachment">
							<a class="check" href="#">&times;</a>
							<div class="attachment-preview">
								<div class="thumbnail">
									<div class="centered">
										<?php
										papi_render_html_tag( 'img', [
											'alt' => esc_attr( $file->alt ),
											'src' => esc_attr( $url )
										] );

										papi_render_html_tag( 'input', [
											'name'  => esc_attr( $slug ),
											'type'  => 'hidden',
											'value' => $file->id
										] );

										if ( ! isset( $file->file ) && isset( $file->url ) ) {
											$file->file = $file->url;
										}
										?>
									</div>
									<?php if ( $this->file_type === 'file' ): ?>
										<div class="filename">
											<div><?php echo esc_html( basename( $file->file ) ); ?></div>
										</div>
									<?php endif; ?>
								</div>
							</div>
						</div>
					<?php
					endforeach;
				endif;
				?>
			</div>
			<div class="clear"></div>
		</div>
	<?php
	}
public function html() {
		$css_classes = '';
		$labels      = $this->get_labels();
		$settings    = $this->get_settings();
		$slug        = $this->html_name();
		$value       = papi_to_array( $this->get_value() );

		// Keep only valid objects.
		$value = array_filter( $value, function ( $item ) {
			return is_object( $item ) && isset( $item->id ) && ! empty( $item->id );
		} );

		$show_button = empty( $value );

		if ( $settings->multiple ) {
			$css_classes .= ' multiple ';
			$slug .= '[]';
			$show_button = true;
		}
		?>

		<div class="papi-property-file <?php echo esc_attr( $css_classes ); ?>" data-file-type="<?php echo esc_attr( $this->file_type ); ?>">
			<p class="papi-file-select <?php echo $show_button ? '' : 'papi-hide'; ?>">
				<?php
				if ( ! $settings->multiple ) {
					echo esc_html( $labels['no_file'] ) . '&nbsp;';
				}

				papi_render_html_tag( 'input', [
					'name'  => esc_attr( $slug ),
					'type'  => 'hidden',
					'value' => ''
				] );

				papi_render_html_tag( 'button', [
					'data-slug' => esc_attr( $slug ),
					'class'     => 'button',
					'type'      => 'button',

					esc_html( $labels['add'] )
				] );
				?>
			</p>
			<div class="attachments">
				<?php
				if ( is_array( $value ) ):
					foreach ( $value as $file ):
						if ( ! is_object( $file ) ) {
							continue;
						}

						$url = wp_get_attachment_thumb_url( $file->id );

						if ( empty( $url ) ) {
							$url = wp_mime_type_icon( $file->id );
						}
						?>
						<div class="attachment">
							<a class="check" href="#">&times;</a>
							<div class="attachment-preview">
								<div class="thumbnail">
									<div class="centered">
										<?php
										papi_render_html_tag( 'img', [
											'alt' => esc_attr( $file->alt ),
											'src' => esc_attr( $url )
										] );

										papi_render_html_tag( 'input', [
											'name'  => esc_attr( $slug ),
											'type'  => 'hidden',
											'value' => $file->id
										] );

										if ( ! isset( $file->file ) && isset( $file->url ) ) {
											$file->file = $file->url;
										}
										?>
									</div>
									<?php if ( $this->file_type === 'file' ): ?>
										<div class="filename">
											<div><?php echo esc_html( basename( $file->file ) ); ?></div>
										</div>
									<?php endif; ?>
								</div>
							</div>
						</div>
					<?php
					endforeach;
				endif;
				?>
			</div>
			<div class="clear"></div>
		</div>
	<?php
	}
Render property html.