src/types/class-papi-attachment-type.php
public function edit_attachment( $form_fields, $post ) {
		foreach ( $this->get_boxes() as $box ) {
			if ( ! empty( $box->title ) ) {
				$form_fields['papi-media-title-' . uniqid()] = [
					'label' => '',
					'input' => 'html',
					'html'  => '<h4 class="papi-media-title">' . $box->title . '</h4>'
				];
			}

			foreach ( $box->properties as $prop ) {
				// Raw output is required.
				$prop->raw = true;

				// Set post id to the property.
				$prop->set_post_id( $post->ID );

				// Add property to form fields.
				$form_fields[$prop->get_slug()] = [
					'label' => $prop->title,
					'input' => 'html',
					'helps' => $prop->description,
					'html'  => papi_maybe_get_callable_value(
						'papi_render_property',
						$prop
					)
				];
			}
		}

		// Add nonce field.
		$form_fields['papi_meta_nonce'] = [
			'label' => '',
			'input' => 'html',
			'html'  => sprintf(
				'<input name="papi_meta_nonce" type="hidden" value="%s" />',
				wp_create_nonce( 'papi_save_data' )
			)
		];

		return $form_fields;
	}
public function edit_attachment( $form_fields, $post ) {
		foreach ( $this->get_boxes() as $box ) {
			if ( ! empty( $box->title ) ) {
				$form_fields['papi-media-title-' . uniqid()] = [
					'label' => '',
					'input' => 'html',
					'html'  => '<h4 class="papi-media-title">' . $box->title . '</h4>'
				];
			}

			foreach ( $box->properties as $prop ) {
				// Raw output is required.
				$prop->raw = true;

				// Set post id to the property.
				$prop->set_post_id( $post->ID );

				// Add property to form fields.
				$form_fields[$prop->get_slug()] = [
					'label' => $prop->title,
					'input' => 'html',
					'helps' => $prop->description,
					'html'  => papi_maybe_get_callable_value(
						'papi_render_property',
						$prop
					)
				];
			}
		}

		// Add nonce field.
		$form_fields['papi_meta_nonce'] = [
			'label' => '',
			'input' => 'html',
			'html'  => sprintf(
				'<input name="papi_meta_nonce" type="hidden" value="%s" />',
				wp_create_nonce( 'papi_save_data' )
			)
		];

		return $form_fields;
	}
Add attachment fields.

@param  array   $form_fields
@param  WP_Post $post

@return array