PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.0.8
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.0.8
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
convertkit / views / backend / tinymce / modal-field.php

modal-field.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.0.8, at views/backend/tinymce/modal-field.php

131 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * TinyMCE Modal Field view
4 *
5 * @package ConvertKit
6 * @author ConvertKit
7 */
8
9 switch ( $field['type'] ) {
10
11 /**
12 * Text
13 */
14 case 'text':
15 ?>
16 <input type="text"
17 id="tinymce_modal_<?php echo esc_attr( $field_name ); ?>"
18 name="<?php echo esc_attr( $field_name ); ?>"
19 value="<?php echo esc_attr( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' ); ?>"
20 data-shortcode="<?php echo esc_attr( $field_name ); ?>"
21 placeholder="<?php echo esc_attr( isset( $field['placeholder'] ) ? $field['placeholder'] : '' ); ?>"
22 <?php echo ( array_key_exists( 'display_if', $field ) ? ' data-display-if="' . esc_attr( $field['display_if']['key'] ) . '" data-display-if-value="' . esc_attr( $field['display_if']['value'] ) . '"' : '' ); ?>
23 class="widefat" />
24 <?php
25 break;
26
27 /**
28 * Number
29 */
30 case 'number':
31 ?>
32 <input type="number"
33 id="tinymce_modal_<?php echo esc_attr( $field_name ); ?>"
34 name="<?php echo esc_attr( $field_name ); ?>"
35 value="<?php echo esc_attr( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' ); ?>"
36 data-shortcode="<?php echo esc_attr( $field_name ); ?>"
37 min="<?php echo esc_attr( $field['min'] ); ?>"
38 max="<?php echo esc_attr( $field['max'] ); ?>"
39 step="<?php echo esc_attr( $field['step'] ); ?>"
40 <?php echo ( array_key_exists( 'display_if', $field ) ? ' data-display-if="' . esc_attr( $field['display_if']['key'] ) . '" data-display-if-value="' . esc_attr( $field['display_if']['value'] ) . '"' : '' ); ?>
41 class="widefat" />
42 <?php
43 break;
44
45 /**
46 * Select
47 */
48 case 'resource':
49 case 'select':
50 ?>
51 <select name="<?php echo esc_attr( $field_name ); ?>"
52 id="tinymce_modal_<?php echo esc_attr( $field_name ); ?>"
53 data-shortcode="<?php echo esc_attr( $field_name ); ?>"
54 size="1"
55 <?php echo ( array_key_exists( 'display_if', $field ) ? ' data-display-if="' . esc_attr( $field['display_if']['key'] ) . '" data-display-if-value="' . esc_attr( $field['display_if']['value'] ) . '"' : '' ); ?>
56 class="widefat">
57 <?php
58 $field['default_value'] = ( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' );
59 foreach ( $field['values'] as $value => $label ) {
60 ?>
61 <option value="<?php echo esc_attr( $value ); ?>"<?php selected( $field['default_value'], $value ); ?>>
62 <?php echo esc_attr( $label ); ?>
63 </option>
64 <?php
65 }
66 ?>
67 </select>
68 <?php
69 // Display a refresh resource button if the field type is resource.
70 if ( $field['type'] === 'resource' ) {
71 $button_title = sprintf(
72 /* translators: Resource Type (Forms, Products, Tags etc). */
73 __( 'Refresh %s from Kit account', 'convertkit' ),
74 $field['resource']
75 );
76 ?>
77 <button class="wp-convertkit-refresh-resources button button-secondary hide-if-no-js"
78 title="<?php echo esc_attr( $button_title ); ?>"
79 data-resource="<?php echo esc_attr( $field['resource'] ); ?>"
80 data-field="#tinymce_modal_<?php echo esc_attr( $field_name ); ?>">
81 <span class="dashicons dashicons-update"></span>
82 </button>
83 <?php
84 }
85 break;
86
87 /**
88 * Toggle
89 */
90 case 'toggle':
91 ?>
92 <select name="<?php echo esc_attr( $field_name ); ?>"
93 id="tinymce_modal_<?php echo esc_attr( $field_name ); ?>"
94 data-shortcode="<?php echo esc_attr( $field_name ); ?>"
95 size="1"
96 <?php echo ( array_key_exists( 'display_if', $field ) ? ' data-display-if="' . esc_attr( $field['display_if']['key'] ) . '" data-display-if-value="' . esc_attr( $field['display_if']['value'] ) . '"' : '' ); ?>
97 class="widefat">
98 <?php
99 $field['default_value'] = ( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' );
100 ?>
101 <option value="0"<?php selected( $field['default_value'], 0 ); ?>><?php esc_html_e( 'No', 'convertkit' ); ?></option>
102 <option value="1"<?php selected( $field['default_value'], 1 ); ?>><?php esc_html_e( 'Yes', 'convertkit' ); ?></option>
103 </select>
104 <?php
105 break;
106
107 /**
108 * Color Picker
109 */
110 case 'color':
111 ?>
112 <input type="color"
113 id="tinymce_modal_<?php echo esc_attr( $field_name ); ?>"
114 name="<?php echo esc_attr( $field_name ); ?>"
115 value="<?php echo esc_attr( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' ); ?>"
116 data-value="<?php echo esc_attr( isset( $shortcode['attributes'][ $field_name ]['default'] ) ? $shortcode['attributes'][ $field_name ]['default'] : '' ); ?>"
117 data-shortcode="<?php echo esc_attr( $field_name ); ?>"
118 placeholder="<?php echo esc_attr( isset( $field['placeholder'] ) ? $field['placeholder'] : '' ); ?>"
119 <?php echo ( array_key_exists( 'display_if', $field ) ? ' data-display-if="' . esc_attr( $field['display_if']['key'] ) . '" data-display-if-value="' . esc_attr( $field['display_if']['value'] ) . '"' : '' ); ?>
120 <?php
121 break;
122 }
123
124 if ( isset( $field['description'] ) ) {
125 ?>
126 <p class="description">
127 <?php echo esc_attr( $field['description'] ); ?>
128 </p>
129 <?php
130 }
131