PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.2.2
Strong Testimonials v3.2.2
3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / admin / custom-fields.php
strong-testimonials / admin Last commit date
challenge 1 year ago css 1 year ago img 1 year ago js 1 year ago menu 1 year ago partials 1 year ago scss 1 year ago settings 1 year ago uninstall 1 year ago admin-notices.php 1 year ago admin.php 1 year ago class-strong-testimonials-addons.php 1 year ago class-strong-testimonials-admin-category-list.php 1 year ago class-strong-testimonials-admin-list.php 1 year ago class-strong-testimonials-admin-scripts.php 1 year ago class-strong-testimonials-debug.php 1 year ago class-strong-testimonials-defaults.php 1 year ago class-strong-testimonials-exporter.php 1 year ago class-strong-testimonials-help.php 1 year ago class-strong-testimonials-helper.php 1 year ago class-strong-testimonials-list-table.php 1 year ago class-strong-testimonials-lite-vs-pro-page.php 1 year ago class-strong-testimonials-page-shortcodes.php 1 year ago class-strong-testimonials-post-editor.php 1 year ago class-strong-testimonials-review.php 1 year ago class-strong-testimonials-updater.php 1 year ago class-strong-testimonials-upsell.php 1 year ago class-strong-testimonials-wpchill-upsells.php 1 year ago class-strong-views-list-table.php 1 year ago class-walker-strong-category-checklist.php 1 year ago class-walker-strong-form-category-checklist.php 1 year ago class-wpmtst-admin-helpers.php 1 year ago class-wpmtst-onboarding.php 1 year ago compat.php 1 year ago custom-fields-ajax.php 1 year ago custom-fields.php 1 year ago form-preview.php 1 year ago view-list-order.php 1 year ago views-ajax.php 1 year ago views-validate.php 1 year ago views.php 1 year ago
custom-fields.php
527 lines
1 <?php
2 /**
3 * Strong Testimonials - Custom fields admin functions
4 */
5
6 function wpmtst_form_admin() {
7 do_action( 'wpmtst_form_admin' );
8 }
9
10 function wpmtst_form_admin2() {
11 wpmtst_settings_custom_fields( 1 );
12 }
13
14 add_action( 'wpmtst_form_admin', 'wpmtst_form_admin2' );
15
16 /**
17 * Save changes to custom fields.
18 *
19 * @since 2.28.5 As separate function on custom action.
20 */
21 function wpmtst_update_custom_fields() {
22 $goback = wp_get_referer();
23 $goback = apply_filters( 'wpmtst_form_goback', $goback );
24
25 if ( ! isset( $_POST['wpmtst_form_submitted'] ) ) {
26 wp_redirect( $goback );
27 exit;
28 }
29
30 if ( ! wp_verify_nonce( $_POST['wpmtst_form_submitted'], 'wpmtst_custom_fields_form' ) ) {
31 wp_redirect( $goback );
32 exit;
33 }
34
35 $form_id = absint( $_POST['form_id'] );
36 $forms = get_option( 'wpmtst_custom_forms' );
37 $field_options = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
38
39 if ( isset( $_POST['reset'] ) ) {
40
41 // Undo changes
42 wpmtst_add_admin_notice( 'changes-cancelled' );
43
44 } elseif ( isset( $_POST['restore-defaults'] ) ) {
45
46 // Restore defaults
47 $default_forms = Strong_Testimonials_Defaults::get_base_forms();
48 $fields = $default_forms['default']['fields'];
49 $forms[ $form_id ]['fields'] = $fields;
50 update_option( 'wpmtst_custom_forms', $forms );
51 do_action( 'wpmtst_fields_updated', $fields );
52
53 wpmtst_add_admin_notice( 'defaults-restored' );
54
55 } else {
56
57 // Save changes
58 $fields = array();
59 $new_key = 0;
60
61 /**
62 * Strip the dang slashes from the dang magic quotes.
63 *
64 * @since 2.0.0
65 */
66 $post_fields = isset( $_POST['fields'] ) ? stripslashes_deep( $_POST['fields'] ) : array();
67
68 foreach ( $post_fields as $key => $field ) {
69
70 /*
71 * Before merging onto base field, catch fields that are "off"
72 * which the form does not submit. Otherwise, the default "on"
73 * would override the requested (but not submitted) "off".
74 */
75 $field['show_label'] = isset( $field['show_label'] ) ? 1 : 0;
76 $field['required'] = isset( $field['required'] ) ? 1 : 0;
77
78 $field = array_merge( $field_options['field_base'], $field );
79
80 $field['name'] = sanitize_text_field( $field['name'] );
81 $field['label'] = sanitize_text_field( $field['label'] );
82 $field['text'] = sanitize_text_field( $field['text'] );
83
84 // TODO Replace this special handling
85 if ( 'checkbox' === $field['input_type'] ) {
86 $field['default_form_value'] = wpmtst_sanitize_checkbox( $field, 'default_form_value' );
87 } else {
88 $field['default_form_value'] = sanitize_text_field( $field['default_form_value'] );
89 }
90 $field['action_input'] = isset( $field['action_input'] ) ? sanitize_text_field( $field['action_input'] ) : '';
91 $field['action_output'] = isset( $field['action_output'] ) ? sanitize_text_field( $field['action_output'] ) : '';
92
93 $field['default_display_value'] = sanitize_text_field( $field['default_display_value'] );
94
95 $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
96
97 $field['before'] = sanitize_text_field( $field['before'] );
98 $field['after'] = sanitize_text_field( $field['after'] );
99
100 $field['shortcode_on_form'] = sanitize_text_field( $field['shortcode_on_form'] );
101 $field['shortcode_on_display'] = sanitize_text_field( $field['shortcode_on_display'] );
102 $field['show_shortcode_options'] = $field['show_shortcode_options'] ? 1 : 0;
103
104 // Hidden options (no need to check if isset)
105 $field['admin_table'] = $field['admin_table'] ? 1 : 0;
106 $field['show_admin_table_option'] = $field['show_admin_table_option'] ? 1 : 0;
107 $field['show_text_option'] = $field['show_text_option'] ? 1 : 0;
108 $field['show_placeholder_option'] = $field['show_placeholder_option'] ? 1 : 0;
109 $field['show_default_options'] = $field['show_default_options'] ? 1 : 0;
110 $field['show_length_option'] = $field['show_length_option'] ? 1 : 0;
111
112 $field = apply_filters( 'wpmtst_sanitize_form_field_options', $field );
113
114 // add to fields array in display order
115 $fields[ $new_key++ ] = $field;
116
117 }
118
119 $forms[ $form_id ]['fields'] = $fields;
120
121 if ( isset( $_POST['field_group_label'] ) ) {
122 // TODO Catch if empty.
123 $new_label = sanitize_text_field( wp_unslash( $_POST['field_group_label'] ) );
124 $forms[ $form_id ]['label'] = $new_label;
125 }
126
127 update_option( 'wpmtst_custom_forms', $forms );
128 do_action( 'wpmtst_fields_updated', $fields );
129
130 wpmtst_add_admin_notice( 'fields-saved' );
131
132 }
133
134 wp_redirect( $goback );
135 exit;
136 }
137
138 add_action( 'admin_post_wpmtst_update_custom_fields', 'wpmtst_update_custom_fields' );
139
140 /**
141 * Custom Fields form
142 *
143 * @param int $form_id
144 */
145 function wpmtst_settings_custom_fields( $form_id = 1 ) {
146 if ( ! current_user_can( 'strong_testimonials_fields' ) ) {
147 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'strong-testimonials' ) );
148 }
149
150 if ( ! $form_id ) {
151 echo '<div class="wrap wpmtst"><p>' . esc_html__( 'No fields selected.', 'strong-testimonials' ) . '</p></div>';
152 return;
153 }
154
155 $forms = get_option( 'wpmtst_custom_forms' );
156 $fields = apply_filters( 'wpmtst_form_fields', $forms[ $form_id ]['fields'] );
157 ?>
158
159 <div class="wrap wpmtst">
160 <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
161
162 <div id="left-col">
163 <div>
164 <h3><?php esc_html_e( 'Editor', 'strong-testimonials' ); ?></h3>
165 <p>
166 <?php esc_html_e( 'Click a field to open its options panel.', 'strong-testimonials' ); ?>
167 <a class="open-help-tab" href="#tab-panel-wpmtst-help"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
168 </p>
169 <?php do_action( 'wpmtst_before_fields_settings', 'form-fields' ); ?>
170 </div>
171
172 <form id="wpmtst-custom-fields-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" autocomplete="off">
173 <?php wp_nonce_field( 'wpmtst_custom_fields_form', 'wpmtst_form_submitted' ); ?>
174 <input type="hidden" name="action" value="wpmtst_update_custom_fields">
175 <input type="hidden" name="form_id" value="<?php echo esc_attr( $form_id ); ?>">
176
177 <?php do_action( 'wpmtst_fields_editor_before_fields_editor', $forms[ $form_id ] ); ?>
178
179 <ul id="custom-field-list">
180 <?php
181 foreach ( $fields as $key => $field ) {
182 echo '<li id="field-' . esc_attr( $key ) . '">' . wpmtst_show_field( $key, $field, false ) . '</li>' . "\n";
183 }
184 ?>
185 </ul>
186
187 <div id="add-field-bar">
188 <input id="add-field" type="button" class="button" name="add-field" value="<?php esc_attr_e( 'Add New Field', 'strong-testimonials' ); ?>">
189 </div>
190
191 <?php do_action( 'wpmtst_admin_after_form_fields' ); ?>
192
193 <div id="field-group-actions">
194 <div><?php submit_button( '', 'primary', 'submit-form', false ); ?></div>
195 <div><?php submit_button( esc_html__( 'Cancel Changes', 'strong-testimonials' ), 'secondary', 'reset', false ); ?></div>
196 <div><?php submit_button( esc_html__( 'Restore Defaults', 'strong-testimonials' ), 'secondary', 'restore-defaults', false ); ?></div>
197 </div>
198 </form>
199 </div><!-- #left-col -->
200
201 <div id="right-col">
202 <div class="intro">
203 <h3><?php esc_html_e( 'Basic Preview', 'strong-testimonials' ); ?></h3>
204 <p><?php esc_html_e( 'Only to demonstrate the fields. May look different in your theme.', 'strong-testimonials' ); ?></p>
205 </div>
206 <?php do_action( 'wpmtst_fields_before_fields_editor_preview' ); ?>
207 <div id="fields-editor-preview">
208 <div><!-- placeholder --></div>
209 </div>
210 </div><!-- #right-col -->
211
212 </div><!-- .wrap -->
213 <?php
214 }
215
216 /**
217 * Add a field to the form
218 *
219 * @param $key
220 * @param $field
221 * @param $adding
222 *
223 * @return string
224 */
225 function wpmtst_show_field( $key, $field, $adding ) {
226 $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
227 $field_types = $fields['field_types'];
228
229 ob_start();
230
231 include 'partials/fields/field-header.php';
232 ?>
233 <div class="custom-field" style="display: none;">
234
235 <table class="field-table">
236 <?php
237 include 'partials/fields/field-type.php';
238 include 'partials/fields/field-label.php';
239 include 'partials/fields/field-name.php';
240
241 if ( ! $adding ) {
242 echo wpmtst_show_field_secondary( $key, $field );
243 echo wpmtst_show_field_admin_table( $key, $field );
244 }
245
246 ?>
247 </table>
248
249 <?php
250 if ( ! $adding ) {
251 echo wp_kses_post( wpmtst_show_field_hidden( $key, $field ) );
252 }
253 include 'partials/fields/field-controls.php';
254 ?>
255 </div><!-- .custom-field -->
256
257 <?php
258 $html = ob_get_contents();
259 ob_end_clean();
260
261 return $html;
262 }
263
264
265 /**
266 * Create the secondary inputs for a new custom field.
267 * Called after field type is chosen (Post or Custom).
268 *
269 * @param $key
270 * @param $field
271 *
272 * @return string
273 */
274 function wpmtst_show_field_secondary( $key, $field ) {
275 $html = '';
276
277 /*
278 * Required
279 */
280 if ( isset( $field['show_required_option'] ) && $field['show_required_option'] ) {
281 // Disable option if this is a core field like post_content.
282 if ( isset( $field['core'] ) && $field['core'] ) {
283 $disabled = ' disabled="disabled"';
284 } else {
285 $disabled = '';
286 }
287
288 $html .= '<tr class="field-secondary">' . "\n";
289 $html .= '<th>' . esc_html__( 'Required', 'strong-testimonials' ) . '</th>' . "\n";
290 $html .= '<td>' . "\n";
291 if ( $disabled ) {
292 $html .= '<input type="hidden" name="fields[' . esc_attr( $key ) . '][required]" value="' . esc_attr( $field['required'] ) . '">';
293 $html .= '<input type="checkbox" ' . checked( $field['required'], true, false ) . $disabled . '>';
294 } else {
295 $html .= '<input type="checkbox" name="fields[' . esc_attr( $key ) . '][required]" ' . checked( $field['required'], true, false ) . '>';
296 }
297 $html .= '</td>' . "\n";
298 $html .= '</tr>' . "\n";
299 }
300
301 /*
302 * Placeholder
303 */
304 if ( $field['show_placeholder_option'] ) {
305 if ( isset( $field['placeholder'] ) ) {
306 $html .= '<tr class="field-secondary">' . "\n";
307 $html .= '<th>' . esc_html__( 'Placeholder', 'strong-testimonials' ) . '</th>' . "\n";
308 $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][placeholder]" value="' . esc_attr( $field['placeholder'] ) . '"></td>' . "\n";
309 $html .= '</tr>' . "\n";
310 }
311 }
312
313 /*
314 * Length
315 */
316 if ( $field['show_length_option'] ) {
317 if ( isset( $field['max_length'] ) ) {
318 $html .= '<tr class="field-secondary">' . "\n";
319 $html .= '<th>' . esc_html__( 'Maximum Length', 'strong-testimonials' ) . '</th>' . "\n";
320 $html .= '<td><input type="number" name="fields[' . esc_attr( $key ) . '][max_length]" value="' . esc_attr( $field['max_length'] ) . '"><span> ' . esc_html__( 'Limit the user imput to a certain number of characters', 'strong-testimonials' ) . '</span></td>' . "\n";
321 $html .= '</tr>' . "\n";
322 }
323 }
324
325 /**
326 * Text (checkbox, radio)
327 *
328 * @since 2.23.0
329 */
330 if ( $field['show_text_option'] ) {
331 if ( isset( $field['text'] ) ) {
332 $html .= '<tr class="field-secondary">' . "\n";
333 $html .= '<th>' . esc_html__( 'Checked value', 'strong-testimonials' ) . '</th>' . "\n";
334 $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][text]" value="' . esc_attr( $field['text'] ) . '" placeholder="' . esc_html__( 'next to the checkbox', 'strong-testimonials' ) . '"></td>' . "\n";
335 $html .= '</tr>' . "\n";
336 }
337 }
338
339 /*
340 * Before
341 */
342 $html .= '<tr class="field-secondary">' . "\n";
343 $html .= '<th>' . esc_html__( 'Before', 'strong-testimonials' ) . '</th>' . "\n";
344 $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][before]" value="' . esc_attr( $field['before'] ) . '"></td>' . "\n";
345 $html .= '</tr>' . "\n";
346
347 /*
348 * After
349 */
350 $html .= '<tr class="field-secondary">' . "\n";
351 $html .= '<th>' . esc_html__( 'After', 'strong-testimonials' ) . '</th>' . "\n";
352 $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][after]" value="' . esc_attr( $field['after'] ) . '"></td>' . "\n";
353 $html .= '</tr>' . "\n";
354
355 /*
356 * Default Form Value
357 */
358 if ( $field['show_default_options'] ) {
359 if ( isset( $field['default_form_value'] ) ) {
360 $html .= '<tr class="field-secondary">' . "\n";
361 $html .= '<th>' . esc_html__( 'Default Form Value', 'strong-testimonials' ) . '</th>' . "\n";
362 $html .= '<td>' . "\n";
363
364 // TODO Replace this special handling
365 if ( 'rating' === $field['input_type'] ) {
366
367 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '" class="as-number">';
368 $html .= '<span class="help inline">' . esc_html__( 'stars', 'strong-testimonials' ) . '</span>';
369 $html .= '<span class="help">' . esc_html__( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
370
371 } elseif ( 'checkbox' === $field['input_type'] ) {
372
373 $html .= '<label>';
374 $html .= '<input type="checkbox" name="fields[' . esc_attr( $key ) . '][default_form_value]" ' . checked( $field['default_form_value'], true, false ) . '>';
375 $html .= '<span class="help inline">' . esc_html__( 'Checked by default.', 'strong-testimonials' ) . '</span>';
376 $html .= '</label>';
377
378 } else {
379
380 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '">';
381 $html .= '<span class="help">' . esc_html__( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
382
383 }
384
385 $html .= '</td>' . "\n";
386 $html .= '</tr>' . "\n";
387 }
388 }
389
390 /*
391 * Default Display Value
392 */
393 if ( $field['show_default_options'] ) {
394 // TODO Replace this special handling for checkbox type
395 if ( 'checkbox' !== $field['input_type'] ) {
396 if ( isset( $field['default_display_value'] ) ) {
397 $html .= '<tr class="field-secondary">' . "\n";
398 $html .= '<th>' . esc_html__( 'Default Display Value', 'strong-testimonials' ) . '</th>' . "\n";
399 $html .= '<td>' . "\n";
400
401 // TODO Replace this special handling
402 if ( 'rating' === $field['input_type'] ) {
403 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '" class="as-number">';
404 $html .= '<span class="help inline">' . esc_html__( 'stars', 'strong-testimonials' ) . '</span>';
405 } else {
406 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '">';
407 }
408
409 $html .= '<span class="help">' . esc_html__( 'Display this on the testimonial if no value is submitted.', 'strong-testimonials' ) . '</span>';
410 $html .= '</td>' . "\n";
411 $html .= '</tr>' . "\n";
412 }
413 }
414 }
415
416 /*
417 * Shortcode Options
418 */
419 if ( $field['show_shortcode_options'] ) {
420 if ( isset( $field['shortcode_on_form'] ) ) {
421 $html .= '<tr class="field-secondary">' . "\n";
422 $html .= '<th>' . esc_html__( 'Shortcode on form', 'strong-testimonials' ) . '</th>' . "\n";
423 $html .= '<td>' . "\n";
424 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][shortcode_on_form]" value="' . esc_attr( $field['shortcode_on_form'] ) . '">';
425 $html .= '</td>' . "\n";
426 $html .= '</tr>' . "\n";
427 }
428 if ( isset( $field['shortcode_on_display'] ) ) {
429 $html .= '<tr class="field-secondary">' . "\n";
430 $html .= '<th>' . esc_html__( 'Shortcode on display', 'strong-testimonials' ) . '</th>' . "\n";
431 $html .= '<td>' . "\n";
432 $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][shortcode_on_display]" value="' . esc_attr( $field['shortcode_on_display'] ) . '">';
433 $html .= '</td>' . "\n";
434 $html .= '</tr>' . "\n";
435 }
436 }
437
438 $html = apply_filters( 'wpmtst_fields_secondary', $html, $key, $field );
439
440 return $html;
441 }
442
443
444 /**
445 * Add type-specific [Admin Table] setting to form.
446 */
447 function wpmtst_show_field_admin_table( $key, $field ) {
448 // -------------------
449 // Show in Admin Table
450 // -------------------
451 if ( ! $field['show_admin_table_option'] ) {
452 $html = '<input type="hidden" name="fields[' . esc_attr( $key ) . '][show_admin_table_option]" value="' . esc_attr( $field['show_admin_table_option'] ) . '">';
453 return $html;
454 }
455
456 $html = '<tr class="field-admin-table">' . "\n";
457 $html .= '<th>' . esc_html__( 'Admin List', 'strong-testimonials' ) . '</th>' . "\n";
458 $html .= '<td>' . "\n";
459 if ( $field['admin_table_option'] ) {
460 $html .= '<label><input type="checkbox" class="field-admin-table" name="fields[' . esc_attr( $key ) . '][admin_table]" ' . checked( $field['admin_table'], 1, false ) . '>';
461 } else {
462 $html .= '<input type="checkbox" ' . checked( $field['admin_table'], 1, false ) . ' disabled="disabled"> <em>' . esc_html__( 'required', 'strong-testimonials' ) . '</em>';
463 $html .= '<input type="hidden" name="fields[' . esc_attr( $key ) . '][admin_table]" value="' . esc_attr( $field['admin_table'] ) . '">';
464 }
465 $html .= '<span class="help inline">' . esc_html__( 'Show this field in the admin list table.', 'strong-testimonials' ) . '</span>';
466 $html .= '</label>';
467 $html .= '</td>' . "\n";
468 $html .= '</tr>' . "\n";
469
470 return $html;
471 }
472
473
474 /**
475 * Add type-specific select options field
476 */
477 function wpmtst_show_field_select_options( $key, $field ) {
478
479 if ( 'select' !== $field['input_type'] ) {
480 return;
481 }
482
483 ob_start();
484 include 'partials/fields/field-select-options.php';
485 return ob_get_clean();
486 }
487
488
489 /**
490 * Add hidden fields to form.
491 *
492 * @param $key
493 * @param $field
494 *
495 * @return string
496 */
497 function wpmtst_show_field_hidden( $key, $field ) {
498 $pattern = '<input type="hidden" name="fields[%s][%s]" value="%s">';
499
500 $html = sprintf( $pattern, $key, 'record_type', $field['record_type'] ) . "\n";
501 $html .= sprintf( $pattern, $key, 'input_type', $field['input_type'] ) . "\n";
502 if ( isset( $field['action_input'] ) ) {
503 $html .= sprintf( $pattern, $key, 'action_input', $field['action_input'] ) . "\n";
504 }
505 if ( isset( $field['action_output'] ) ) {
506 $html .= sprintf( $pattern, $key, 'action_output', $field['action_output'] ) . "\n";
507 }
508 $html .= sprintf( $pattern, $key, 'name_mutable', $field['name_mutable'] ) . "\n";
509 $html .= sprintf( $pattern, $key, 'show_text_option', $field['show_text_option'] ) . "\n";
510 $html .= sprintf( $pattern, $key, 'show_placeholder_option', $field['show_placeholder_option'] ) . "\n";
511 $html .= sprintf( $pattern, $key, 'show_default_options', $field['show_default_options'] ) . "\n";
512 $html .= sprintf( $pattern, $key, 'admin_table_option', $field['admin_table_option'] ) . "\n";
513 $html .= sprintf( $pattern, $key, 'show_admin_table_option', $field['show_admin_table_option'] ) . "\n";
514 $html .= sprintf( $pattern, $key, 'show_shortcode_options', $field['show_shortcode_options'] ) . "\n";
515 $html .= sprintf( $pattern, $key, 'show_length_option', $field['show_length_option'] ) . "\n";
516
517 if ( isset( $field['map'] ) ) {
518 $html .= sprintf( $pattern, $key, 'map', $field['map'] ) . "\n";
519 }
520
521 if ( isset( $field['core'] ) ) {
522 $html .= sprintf( $pattern, $key, 'core', $field['core'] ) . "\n";
523 }
524
525 return $html;
526 }
527