# ghostkit/3.3.2/gutenberg/blocks/form/field-description/index.php

Block Animations, Motion &amp; Scroll Effects – Ghost Kit, version 3.3.2. 49 lines.

- Page: https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/blocks/form/field-description/index.php
- Raw: https://pluginprobe.com/plugins/ghostkit/3.3.2/raw/gutenberg/blocks/form/field-description/index.php
- Modified: 2024-02-18T18:40:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/blocks/form/field-description/index.php#L10-L20`.

```php
<?php
/**
 * Form field description.
 *
 * @package ghostkit
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class GhostKit_Form_Field_Description
 */
class GhostKit_Form_Field_Description {
	/**
	 * Prepare description for field.
	 *
	 * @param array $attributes block attributes.
	 */
	public static function get( $attributes ) {
		$attributes = array_merge(
			array(
				'description'     => '',
				'hideDescription' => false,
			),
			$attributes
		);

		$description      = $attributes['description'];
		$hide_description = $attributes['hideDescription'];
		$class            = 'ghostkit-form-field-description';

		if ( $hide_description ) {
			$class .= ' ghostkit-form-field-description-hidden';
		}

		if ( $description ) {
			?>
			<small class="<?php echo esc_attr( $class ); ?>">
				<?php echo wp_kses_post( $description ); ?>
			</small>
			<input type="hidden" name="<?php echo esc_attr( $attributes['slug'] ); ?>[description]" value="<?php echo esc_attr( $description ); ?>" />
			<?php
		}
	}
}
new GhostKit_Form_Field_Description();

```
