| @@ -48,22 +48,41 @@ | ||
| 48 | 48 | $button_suffix = ''; |
| 49 | 49 | |
| 50 | 50 | ?> |
| 51 | 51 | |
| 52 | -<div class="wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>"> | |
| 52 | +<div class="wdk-field-<?php echo esc_attr($field_id);?> wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>"> | |
| 53 | 53 | <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label> |
| 54 | 54 | <div class="wdk-field-container"> |
| 55 | - <?php echo wmvc_select_option($field_id, $values, wmvc_show_data($field_id, $db_data, '')); ?> | |
| 55 | + <?php | |
| 56 | + echo wp_kses( | |
| 57 | + wmvc_select_option($field_id, $values, wmvc_show_data($field_id, $db_data, '')), | |
| 58 | + [ | |
| 59 | + 'select' => [ | |
| 60 | + 'id' => true, | |
| 61 | + 'name' => true, | |
| 62 | + ], | |
| 63 | + 'option' => [ | |
| 64 | + 'value' => true, | |
| 65 | + 'selected' => true, | |
| 66 | + ], | |
| 67 | + ] | |
| 68 | + ); | |
| 69 | + ?> | |
| 70 | + | |
| 56 | 71 | <span class="suffix"><?php |
| 57 | - echo esc_html($field->prefix); | |
| 72 | + // Dynamic field values are registered in the translation catalog separately. | |
| 73 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 74 | + echo esc_html__($field->prefix, 'wpdirectorykit'); | |
| 58 | 75 | if(!empty($field->prefix) && !empty($field->suffix)) echo ' / '; |
| 59 | - echo esc_html($field->suffix); | |
| 76 | + // Dynamic field values are registered in the translation catalog separately. | |
| 77 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 78 | + echo esc_html__($field->suffix, 'wpdirectorykit'); | |
| 60 | 79 | ?> |
| 61 | 80 | <?php if(!empty(wmvc_show_data($field_id, $db_data, '')) && get_post_status(wmvc_show_data($field_id, $db_data, '')) == 'publish'):?> |
| 62 | - <a class="button button-primary" target="_blank" href="<?php echo get_permalink(wmvc_show_data($field_id, $db_data, ''));?>" style="margin-top: -5px;"> | |
| 81 | + <a class="button button-primary" target="_blank" href="<?php echo esc_url(get_permalink(wmvc_show_data($field_id, $db_data, '')));?>" style="margin-top: -5px;"> | |
| 63 | 82 | <?php echo esc_html__('View Page','wpdirectorykit');?> |
| 64 | 83 | </a> |
| 65 | - <a class="button button" target="_blank" href="<?php echo admin_url('post.php?post='.wmvc_show_data($field_id, $db_data, '').'&action=edit');?>" style="margin-top: -5px;"> | |
| 84 | + <a class="button button" target="_blank" href="<?php echo esc_url(admin_url('post.php?post='.wmvc_show_data($field_id, $db_data, '')).'&action=edit');?>" style="margin-top: -5px;"> | |
| 66 | 85 | <span class="dashicons dashicons-edit"></span> |
| 67 | 86 | </a> |
| 68 | 87 | <?php else:?> |
| 69 | 88 | <?php if(isset($_GET['page']) && $_GET['page'] == 'wpdirectorykit'):?> |