PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.2
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / blocks / form / field-description / index.php

index.php in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/blocks/form/field-description/index.php

49 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Form field description.
4 *
5 * @package ghostkit
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 /**
13 * Class GhostKit_Form_Field_Description
14 */
15 class GhostKit_Form_Field_Description {
16 /**
17 * Prepare description for field.
18 *
19 * @param array $attributes block attributes.
20 */
21 public static function get( $attributes ) {
22 $attributes = array_merge(
23 array(
24 'description' => '',
25 'hideDescription' => false,
26 ),
27 $attributes
28 );
29
30 $description = $attributes['description'];
31 $hide_description = $attributes['hideDescription'];
32 $class = 'ghostkit-form-field-description';
33
34 if ( $hide_description ) {
35 $class .= ' ghostkit-form-field-description-hidden';
36 }
37
38 if ( $description ) {
39 ?>
40 <small class="<?php echo esc_attr( $class ); ?>">
41 <?php echo wp_kses_post( $description ); ?>
42 </small>
43 <input type="hidden" name="<?php echo esc_attr( $attributes['slug'] ); ?>[description]" value="<?php echo esc_attr( $description ); ?>" />
44 <?php
45 }
46 }
47 }
48 new GhostKit_Form_Field_Description();
49