| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | /** |
| 3 | 4 | * The template for Edit Field. |
| 4 | 5 | * |
| 5 | 6 | * This is the template that form edit |
| @@ -5,164 +6,228 @@ | ||
| 5 | 6 | * This is the template that form edit |
| 6 | 7 | * |
| 7 | 8 | */ |
| 8 | 9 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | - exit; // Exit if accessed directly. | |
| 10 | +if (! defined('ABSPATH')) { | |
| 11 | + exit; // Exit if accessed directly. | |
| 11 | 12 | } |
| 12 | 13 | ?> |
| 13 | 14 | <!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 14 | 15 | |
| 15 | 16 | <div class="wrap wdk-wrap"> |
| 16 | - <h1 class="wp-heading-inline"><?php echo __('Fields Management','wpdirectorykit'); ?></h1> | |
| 17 | - <br /><br /> | |
| 17 | + <h1 class="wp-heading-inline"><?php echo esc_html__('Fields Management', 'wpdirectorykit'); ?></h1> | |
| 18 | + <br /> | |
| 18 | 19 | <div class="wdk-body"> |
| 19 | 20 | <div class="postbox" style="display: block;"> |
| 20 | 21 | <div class="postbox-header"> |
| 21 | - <h3><?php echo __('Add/Edit Field','wpdirectorykit'); ?></h3> | |
| 22 | + <h3><?php echo esc_html__('Add/Edit Field', 'wpdirectorykit'); ?></h3> | |
| 22 | 23 | </div> |
| 23 | 24 | <div class="inside"> |
| 24 | 25 | |
| 25 | - <form method="post" action="<?php echo wmvc_current_edit_url(); ?>" novalidate="novalidate"> | |
| 26 | + <form method="post" class="form_listing_ai" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" novalidate="novalidate"> | |
| 26 | 27 | |
| 27 | - <?php wp_nonce_field( 'wdk-fields-edit_'.wmvc_show_data('idfield', $db_data, 0), '_wpnonce'); ?> | |
| 28 | + <?php wp_nonce_field('wdk-fields-edit_' . wmvc_show_data('idfield', $db_data, 0), '_wpnonce'); ?> | |
| 28 | 29 | |
| 29 | - <?php | |
| 30 | - $form->messages('class="alert alert-danger"', sprintf(__('Successfully saved, <a href="%1$s">Back to Fields Management </a>','wpdirectorykit'),admin_url('admin.php?page=wdk_fields'))); | |
| 30 | + <?php | |
| 31 | + $form->messages( | |
| 32 | + 'class="alert alert-danger"', | |
| 33 | + wp_kses( | |
| 34 | + sprintf( | |
| 35 | + /* translators: 1: URL. */ | |
| 36 | + __('Successfully saved, <a href="%1$s">Back to Fields Management </a>', 'wpdirectorykit'), | |
| 37 | + esc_url(admin_url('admin.php?page=wdk_fields')) | |
| 38 | + ), | |
| 39 | + array( | |
| 40 | + 'a' => array( | |
| 41 | + 'href' => true, | |
| 42 | + ), | |
| 43 | + ) | |
| 44 | + ) | |
| 45 | + ); | |
| 31 | 46 | ?> |
| 32 | 47 | |
| 33 | 48 | <table class="form-table" role="presentation"> |
| 34 | 49 | <tbody> |
| 35 | - <?php if(wmvc_show_data('field_type', $db_data) != "SECTION"):?> | |
| 50 | + <?php if (wmvc_show_data('field_type', $db_data) != "SECTION"): ?> | |
| 51 | + <tr> | |
| 52 | + <th scope="row"> | |
| 53 | + <label for="field_type"><?php echo esc_html__('Section', 'wpdirectorykit'); ?></label> | |
| 54 | + </th> | |
| 55 | + <td> | |
| 56 | + <?php | |
| 57 | + echo wp_kses( | |
| 58 | + wmvc_select_option('section', $section_list, $selected_section), | |
| 59 | + array( | |
| 60 | + 'select' => array( | |
| 61 | + 'id' => true, | |
| 62 | + 'name' => true, | |
| 63 | + 'class' => true, | |
| 64 | + 'style' => true, | |
| 65 | + 'multiple' => true, | |
| 66 | + 'size' => true, | |
| 67 | + ), | |
| 68 | + 'option' => array( | |
| 69 | + 'value' => true, | |
| 70 | + 'selected' => true, | |
| 71 | + 'disabled' => true, | |
| 72 | + ), | |
| 73 | + ) | |
| 74 | + ); | |
| 75 | + | |
| 76 | + ?> | |
| 77 | + </td> | |
| 78 | + </tr> | |
| 79 | + <?php endif; ?> | |
| 36 | 80 | <tr> |
| 37 | 81 | <th scope="row"> |
| 38 | - <label for="field_type"><?php echo __('Section','wpdirectorykit'); ?></label> | |
| 82 | + <label for="field_type"><?php echo esc_html__('Field Type', 'wpdirectorykit'); ?></label> | |
| 39 | 83 | </th> |
| 40 | 84 | <td> |
| 41 | - <?php | |
| 42 | - echo wmvc_select_option('section', $section_list, (!empty(wmvc_show_data('idfield', $db_data, '')) && isset($fields_categories[wmvc_show_data('idfield', $db_data, '')])) ? $fields_categories[wmvc_show_data('idfield', $db_data)] : ''); | |
| 85 | + <?php | |
| 86 | + echo wp_kses( | |
| 87 | + wmvc_select_option('field_type', $field_types, wmvc_show_data('field_type', $db_data, '')), | |
| 88 | + array( | |
| 89 | + 'select' => array( | |
| 90 | + 'id' => true, | |
| 91 | + 'name' => true, | |
| 92 | + 'class' => true, | |
| 93 | + 'style' => true, | |
| 94 | + 'multiple' => true, | |
| 95 | + 'size' => true, | |
| 96 | + ), | |
| 97 | + 'option' => array( | |
| 98 | + 'value' => true, | |
| 99 | + 'selected' => true, | |
| 100 | + 'disabled' => true, | |
| 101 | + ), | |
| 102 | + ) | |
| 103 | + ); | |
| 104 | + | |
| 43 | 105 | ?> |
| 44 | 106 | </td> |
| 45 | 107 | </tr> |
| 46 | - <?php endif;?> | |
| 47 | 108 | <tr> |
| 48 | 109 | <th scope="row"> |
| 49 | - <label for="field_type"><?php echo __('Field Type','wpdirectorykit'); ?></label> | |
| 110 | + <label for="date_format"><?php echo esc_html__('Date format', 'wpdirectorykit'); ?></label> | |
| 50 | 111 | </th> |
| 51 | 112 | <td> |
| 52 | - <?php | |
| 53 | - echo wmvc_select_option('field_type', $field_types, wmvc_show_data('field_type', $db_data, '')); | |
| 54 | - ?> | |
| 113 | + <input name="date_format" type="text" id="date_format" | |
| 114 | + value="<?php echo esc_attr(wmvc_show_data('date_format', $db_data, '')); ?>" | |
| 115 | + class="regular-text"> | |
| 116 | + <p class="description" id="hint-description"> | |
| 117 | + <?php echo esc_html__('Date Format for Front - End View', 'wpdirectorykit'); ?> | |
| 118 | + </p> | |
| 55 | 119 | </td> |
| 56 | 120 | </tr> |
| 57 | 121 | <tr> |
| 58 | 122 | <th scope="row"> |
| 59 | - <label for="field_label"><?php echo __('Field Label','wpdirectorykit'); ?></label> | |
| 123 | + <label for="field_label"><?php echo esc_html__('Field Label', 'wpdirectorykit'); ?></label> | |
| 60 | 124 | </th> |
| 61 | 125 | <td> |
| 62 | 126 | <input name="field_label" type="text" id="field_label" |
| 63 | - value="<?php echo wmvc_show_data('field_label', $db_data, ''); ?>" | |
| 127 | + value="<?php echo esc_attr(wmvc_show_data('field_label', $db_data, '')); ?>" | |
| 64 | 128 | class="regular-text"> |
| 129 | + | |
| 65 | 130 | </td> |
| 66 | 131 | </tr> |
| 67 | 132 | <tr> |
| 68 | - <th scope="row"><label for="hint"><?php echo __('Hint','wpdirectorykit'); ?></label> | |
| 133 | + <th scope="row"><label for="hint"><?php echo esc_html__('Hint', 'wpdirectorykit'); ?></label> | |
| 69 | 134 | </th> |
| 70 | 135 | <td> |
| 71 | 136 | <input name="hint" type="text" id="hint" |
| 72 | - value="<?php echo wmvc_show_data('hint', $db_data, ''); ?>" | |
| 137 | + value="<?php echo esc_attr(wmvc_show_data('hint', $db_data, '')); ?>" | |
| 73 | 138 | class="regular-text"> |
| 74 | 139 | <p class="description" id="hint-description"> |
| 75 | - <?php echo __('Hint is showing below fields like this one','wpdirectorykit'); ?> | |
| 140 | + <?php echo esc_html__('Hint is showing below fields like this one', 'wpdirectorykit'); ?> | |
| 76 | 141 | </p> |
| 77 | 142 | </td> |
| 78 | 143 | </tr> |
| 79 | 144 | <tr> |
| 80 | - <th scope="row"><label for="placeholder"><?php echo __('Placeholder','wpdirectorykit'); ?></label> | |
| 145 | + <th scope="row"><label for="placeholder"><?php echo esc_html__('Placeholder', 'wpdirectorykit'); ?></label> | |
| 81 | 146 | </th> |
| 82 | 147 | <td> |
| 83 | 148 | <input name="placeholder" type="text" id="placeholder" |
| 84 | - value="<?php echo wmvc_show_data('placeholder', $db_data, ''); ?>" | |
| 149 | + value="<?php echo esc_attr(wmvc_show_data('placeholder', $db_data, '')); ?>" | |
| 85 | 150 | class="regular-text"> |
| 86 | 151 | <p class="description" id="placeholder-description"> |
| 87 | - <?php echo __('Placeholder is showing on placeholder of fields or first value on dropdown','wpdirectorykit'); ?> | |
| 152 | + <?php echo esc_html__('Placeholder is showing on placeholder of fields or first value on dropdown', 'wpdirectorykit'); ?> | |
| 88 | 153 | </p> |
| 89 | 154 | </td> |
| 90 | 155 | </tr> |
| 91 | 156 | <tr> |
| 92 | 157 | <th scope="row"><label |
| 93 | - for="columns_number"><?php echo __('Columns number/Width','wpdirectorykit'); ?></label> | |
| 158 | + for="columns_number"><?php echo esc_html__('Columns number/Width', 'wpdirectorykit'); ?></label> | |
| 94 | 159 | </th> |
| 95 | 160 | <td> |
| 96 | 161 | <input name="columns_number" type="number" id="columns_number" |
| 97 | - value="<?php echo wmvc_show_data('columns_number', $db_data, ''); ?>" | |
| 162 | + value="<?php echo esc_attr(wmvc_show_data('columns_number', $db_data, '')); ?>" | |
| 98 | 163 | class="regular-text"> |
| 99 | 164 | <p class="description" id="columns_number-description"> |
| 100 | - <?php echo __('Full width is 12 columns, so define wanted columns allocation number for this field','wpdirectorykit'); ?> | |
| 165 | + <?php echo esc_html__('Full width is 12 columns, so define wanted columns allocation number for this field', 'wpdirectorykit'); ?> | |
| 101 | 166 | </p> |
| 102 | 167 | </td> |
| 103 | 168 | </tr> |
| 104 | 169 | <tr> |
| 105 | - <th scope="row"><?php echo __('Field is required','wpdirectorykit'); ?></th> | |
| 170 | + <th scope="row"><?php echo esc_html__('Field is required', 'wpdirectorykit'); ?></th> | |
| 106 | 171 | <td> |
| 107 | 172 | <fieldset> |
| 108 | 173 | <legend class="screen-reader-text"> |
| 109 | - <span><?php echo __('Field is required','wpdirectorykit'); ?></span> | |
| 174 | + <span><?php echo esc_html__('Field is required', 'wpdirectorykit'); ?></span> | |
| 110 | 175 | </legend> |
| 111 | 176 | <label for="is_required"> |
| 112 | 177 | <input name="is_required" type="checkbox" id="is_required" |
| 113 | 178 | value="1" |
| 114 | - <?php echo !empty(wmvc_show_data('is_required', $db_data, ''))?'checked':''; ?>> | |
| 115 | - <?php echo __('Required','wpdirectorykit'); ?> | |
| 116 | - <?php echo __('( Not for section type)','wpdirectorykit'); ?> | |
| 179 | + <?php echo !empty(wmvc_show_data('is_required', $db_data, '')) ? 'checked' : ''; ?>> | |
| 180 | + <?php echo esc_html__('Required', 'wpdirectorykit'); ?> | |
| 181 | + <?php echo esc_html__('( Not for section type)', 'wpdirectorykit'); ?> | |
| 117 | 182 | </label> |
| 118 | 183 | </fieldset> |
| 119 | 184 | </td> |
| 120 | 185 | </tr> |
| 121 | 186 | <tr> |
| 122 | - <th scope="row"><?php echo __('Field is visible on Listing Preview','wpdirectorykit'); ?></th> | |
| 187 | + <th scope="row"><?php echo esc_html__('Field is visible on Listing Preview', 'wpdirectorykit'); ?></th> | |
| 123 | 188 | <td> |
| 124 | 189 | <fieldset> |
| 125 | 190 | <legend class="screen-reader-text"> |
| 126 | - <span><?php echo __('Field is visible on Listing Preview','wpdirectorykit'); ?></span> | |
| 191 | + <span><?php echo esc_html__('Field is visible on Listing Preview', 'wpdirectorykit'); ?></span> | |
| 127 | 192 | </legend> |
| 128 | 193 | <label for="is_visible_frontend"> |
| 129 | 194 | <input name="is_visible_frontend" type="checkbox" id="is_visible_frontend" |
| 130 | 195 | value="1" |
| 131 | - <?php echo !empty(wmvc_show_data('is_visible_frontend', $db_data, ''))?'checked':''; ?>> | |
| 132 | - <?php echo __('( Not for section type)','wpdirectorykit'); ?> | |
| 196 | + <?php echo !empty(wmvc_show_data('is_visible_frontend', $db_data, '')) ? 'checked' : ''; ?>> | |
| 197 | + <?php echo esc_html__('( Not for section type)', 'wpdirectorykit'); ?> | |
| 133 | 198 | </label> |
| 134 | 199 | </fieldset> |
| 135 | 200 | </td> |
| 136 | 201 | </tr> |
| 137 | 202 | <tr> |
| 138 | - <th scope="row"><?php echo __('Field is visible on frontend submission','wpdirectorykit'); ?></th> | |
| 203 | + <th scope="row"><?php echo esc_html__('Field is visible on frontend submission', 'wpdirectorykit'); ?></th> | |
| 139 | 204 | <td> |
| 140 | 205 | <fieldset> |
| 141 | 206 | <legend class="screen-reader-text"> |
| 142 | - <span><?php echo __('Field is visible on frontend submission','wpdirectorykit'); ?></span> | |
| 207 | + <span><?php echo esc_html__('Field is visible on frontend submission', 'wpdirectorykit'); ?></span> | |
| 143 | 208 | </legend> |
| 144 | 209 | <label for="is_visible_dashboard"> |
| 145 | 210 | <input name="is_visible_dashboard" type="checkbox" id="is_visible_dashboard" |
| 146 | 211 | value="1" |
| 147 | - <?php echo !empty(wmvc_show_data('is_visible_dashboard', $db_data, ''))?'checked':''; ?>> | |
| 148 | - <?php echo __('( Not for section type)','wpdirectorykit'); ?> | |
| 212 | + <?php echo !empty(wmvc_show_data('is_visible_dashboard', $db_data, '')) ? 'checked' : ''; ?>> | |
| 213 | + <?php echo esc_html__('( Not for section type)', 'wpdirectorykit'); ?> | |
| 149 | 214 | </label> |
| 150 | 215 | </fieldset> |
| 151 | 216 | </td> |
| 152 | 217 | </tr> |
| 153 | 218 | <tr> |
| 154 | - <th scope="row"><?php echo __('Price format','wpdirectorykit'); ?></th> | |
| 219 | + <th scope="row"><?php echo esc_html__('Price format', 'wpdirectorykit'); ?></th> | |
| 155 | 220 | <td> |
| 156 | 221 | <fieldset> |
| 157 | 222 | <legend class="screen-reader-text"> |
| 158 | - <span><?php echo __('Price format','wpdirectorykit'); ?></span> | |
| 223 | + <span><?php echo esc_html__('Price format', 'wpdirectorykit'); ?></span> | |
| 159 | 224 | </legend> |
| 160 | 225 | <label for="is_price_format"> |
| 161 | 226 | <input name="is_price_format" type="checkbox" id="is_price_format" |
| 162 | 227 | value="1" |
| 163 | - <?php echo !empty(wmvc_show_data('is_price_format', $db_data, ''))?'checked':''; ?>> | |
| 164 | - <?php echo __('Use wp price format based on language ( Only for number field type)','wpdirectorykit'); ?> | |
| 228 | + <?php echo !empty(wmvc_show_data('is_price_format', $db_data, '')) ? 'checked' : ''; ?>> | |
| 229 | + <?php echo esc_html__('Use wp price format based on language ( Only for number field type)', 'wpdirectorykit'); ?> | |
| 165 | 230 | </label> |
| 166 | 231 | </fieldset> |
| 167 | 232 | </td> |
| 168 | 233 | </tr> |
| @@ -167,120 +232,185 @@ | ||
| 167 | 232 | </td> |
| 168 | 233 | </tr> |
| 169 | 234 | <tr> |
| 170 | 235 | <th scope="row"> |
| 171 | - <label for="validation"><?php echo __('Validation','wpdirectorykit'); ?></label> | |
| 236 | + <label for="validation"><?php echo esc_html__('Validation', 'wpdirectorykit'); ?></label> | |
| 172 | 237 | </th> |
| 173 | 238 | <td> |
| 174 | - <?php | |
| 175 | - echo wmvc_select_option('validation', array_merge(array(''=> __('Not Selected','wpdirectorykit')),$this->field_m->fields_validations), wmvc_show_data('validation', $db_data, ''), 'id="validation"'); | |
| 239 | + <?php | |
| 240 | + echo wp_kses( | |
| 241 | + wmvc_select_option( | |
| 242 | + 'validation', | |
| 243 | + array_merge(array('' => __('Not Selected', 'wpdirectorykit')), $this->field_m->fields_validations), | |
| 244 | + wmvc_show_data('validation', $db_data, ''), | |
| 245 | + 'id="validation"' | |
| 246 | + ), | |
| 247 | + array( | |
| 248 | + 'select' => array( | |
| 249 | + 'id' => true, | |
| 250 | + 'name' => true, | |
| 251 | + 'class' => true, | |
| 252 | + 'style' => true, | |
| 253 | + 'multiple' => true, | |
| 254 | + 'size' => true, | |
| 255 | + ), | |
| 256 | + 'option' => array( | |
| 257 | + 'value' => true, | |
| 258 | + 'selected' => true, | |
| 259 | + 'disabled' => true, | |
| 260 | + ), | |
| 261 | + ) | |
| 262 | + ); | |
| 263 | + | |
| 176 | 264 | ?> |
| 177 | 265 | </td> |
| 178 | 266 | </tr> |
| 179 | 267 | <tr> |
| 268 | + <th scope="row"> | |
| 269 | + <label for="autosuggestion"><?php echo esc_html__('Autosuggestion', 'wpdirectorykit'); ?></label> | |
| 270 | + </th> | |
| 271 | + <td> | |
| 272 | + <select name="autosuggestion" id="autosuggestion" | |
| 273 | + <?php if (!file_exists(ABSPATH . 'wp-content/plugins/wdk-autosuggestion/wdk-autosuggestion.php')): ?> | |
| 274 | + class="wdk-pro-select" | |
| 275 | + data-button-success="<?php echo esc_attr__('Purchase Now', 'wpdirectorykit'); ?>" | |
| 276 | + data-title="<?php echo esc_attr__('Your version doesn\'t support this functionality, please upgrade', 'wpdirectorykit'); ?>" | |
| 277 | + data-content="<?php echo esc_attr__('We constantly maintain compatibility and improving this plugin for living, please support us and purchase, we provide very reasonable prices and will always do our best to help you!', 'wpdirectorykit'); ?>" | |
| 278 | + data-action="https://www.wpdirectorykit.com/plugins.html/" | |
| 279 | + <?php elseif (file_exists(ABSPATH . 'wp-content/plugins/wdk-autosuggestion/wdk-autosuggestion.php') && !function_exists('run_wdk_autosuggestion')): ?> | |
| 280 | + class="wdk-pro-select" | |
| 281 | + data-button-success="<?php echo esc_attr__('Activate addon WDK Autosuggestion', 'wpdirectorykit'); ?>" | |
| 282 | + data-title="<?php echo esc_attr__('Your version doesn\'t support this functionality, please upgrade', 'wpdirectorykit'); ?>" | |
| 283 | + data-content="<?php echo esc_attr__('We constantly maintain compatibility and improving this plugin for living, please support us and purchase, we provide very reasonable prices and will always do our best to help you!', 'wpdirectorykit'); ?>" | |
| 284 | + data-action="<?php echo esc_url(get_admin_url() . "plugins.php?plugin_status=all#activate-wdk-autosuggestion"); ?>" | |
| 285 | + <?php endif; ?>> | |
| 286 | + <option value=""><?php echo esc_html__('Not Selected', 'wpdirectorykit'); ?></option> | |
| 287 | + <?php foreach ($this->field_m->fields_autosuggestions as $key => $value): ?> | |
| 288 | + <option class="<?php if (in_array($key, ['google_api_cities', 'google_api_countries', 'rapid_api_cities'])): ?>pro-value<?php endif; ?>" value="<?php echo esc_attr($key); ?>" <?php echo !empty(wmvc_show_data('autosuggestion', $db_data, '') == $key) ? 'selected="selected"' : ''; ?>><?php echo esc_html($value); ?></option> | |
| 289 | + <?php endforeach; ?> | |
| 290 | + </select> | |
| 291 | + </td> | |
| 292 | + </tr> | |
| 293 | + <tr> | |
| 180 | 294 | <th scope="row"><label |
| 181 | - for="min_length"><?php echo __('Min Length','wpdirectorykit'); ?></label> | |
| 295 | + for="min_length"><?php echo esc_html__('Min Length', 'wpdirectorykit'); ?></label> | |
| 182 | 296 | </th> |
| 183 | 297 | <td> |
| 184 | 298 | <input name="min_length" type="number" id="min_length" |
| 185 | - value="<?php echo wmvc_show_data('min_length', $db_data, ''); ?>" | |
| 299 | + value="<?php echo esc_attr(wmvc_show_data('min_length', $db_data, '')); ?>" | |
| 186 | 300 | class="regular-text"> |
| 187 | 301 | <p class="description" id="columns_number-description"> |
| 188 | - <?php echo __('Min Characters or min number (if number field type)','wpdirectorykit'); ?> | |
| 302 | + <?php echo esc_html__('Min Characters or min number (if number field type)', 'wpdirectorykit'); ?> | |
| 189 | 303 | </p> |
| 190 | 304 | </td> |
| 191 | 305 | </tr> |
| 192 | 306 | <tr> |
| 193 | 307 | <th scope="row"><label |
| 194 | - for="max_length"><?php echo __('Max Length','wpdirectorykit'); ?></label> | |
| 308 | + for="max_length"><?php echo esc_html__('Max Length', 'wpdirectorykit'); ?></label> | |
| 195 | 309 | </th> |
| 196 | 310 | <td> |
| 197 | 311 | <input name="max_length" type="number" id="max_length" |
| 198 | - value="<?php echo wmvc_show_data('max_length', $db_data, ''); ?>" | |
| 312 | + value="<?php echo esc_attr(wmvc_show_data('max_length', $db_data, '')); ?>" | |
| 199 | 313 | class="regular-text"> |
| 200 | 314 | <p class="description" id="columns_number-description"> |
| 201 | - <?php echo __('Max Characters or max number (if number field type)','wpdirectorykit'); ?> | |
| 315 | + <?php echo esc_html__('Max Characters or max number (if number field type)', 'wpdirectorykit'); ?> | |
| 202 | 316 | </p> |
| 203 | 317 | </td> |
| 204 | 318 | </tr> |
| 205 | - <?php if(false):?> | |
| 319 | + <?php if (false): ?> | |
| 320 | + <tr> | |
| 321 | + <th scope="row"><?php echo esc_html__('Visible on', 'wpdirectorykit'); ?></th> | |
| 322 | + <td> | |
| 323 | + <fieldset> | |
| 324 | + <legend class="screen-reader-text"> | |
| 325 | + <span><?php echo esc_html__('Visible on', 'wpdirectorykit'); ?></span> | |
| 326 | + </legend> | |
| 327 | + <label for="is_visible_frontend"> | |
| 328 | + <input name="is_visible_frontend" type="checkbox" id="is_visible_frontend" | |
| 329 | + value="1" | |
| 330 | + <?php echo !empty(wmvc_show_data('is_visible_frontend', $db_data, '')) ? 'checked' : ''; ?>> | |
| 331 | + <?php echo esc_html__('Frontend', 'wpdirectorykit'); ?> | |
| 332 | + </label> | |
| 333 | + <label for="is_visible_dashboard"> | |
| 334 | + <input name="is_visible_dashboard" type="checkbox" id="is_visible_dashboard" | |
| 335 | + value="1" | |
| 336 | + <?php echo !empty(wmvc_show_data('is_visible_dashboard', $db_data, '')) ? 'checked' : ''; ?>> | |
| 337 | + <?php echo esc_html__('Dashboard', 'wpdirectorykit'); ?> | |
| 338 | + </label> | |
| 339 | + </fieldset> | |
| 340 | + </td> | |
| 341 | + </tr> | |
| 342 | + <?php endif; ?> | |
| 206 | 343 | <tr> |
| 207 | - <th scope="row"><?php echo __('Visible on','wpdirectorykit'); ?></th> | |
| 208 | - <td> | |
| 209 | - <fieldset> | |
| 210 | - <legend class="screen-reader-text"> | |
| 211 | - <span><?php echo __('Visible on','wpdirectorykit'); ?></span> | |
| 212 | - </legend> | |
| 213 | - <label for="is_visible_frontend"> | |
| 214 | - <input name="is_visible_frontend" type="checkbox" id="is_visible_frontend" | |
| 215 | - value="1" | |
| 216 | - <?php echo !empty(wmvc_show_data('is_visible_frontend', $db_data, ''))?'checked':''; ?>> | |
| 217 | - <?php echo __('Frontend','wpdirectorykit'); ?> | |
| 218 | - </label> | |
| 219 | - <label for="is_visible_dashboard"> | |
| 220 | - <input name="is_visible_dashboard" type="checkbox" id="is_visible_dashboard" | |
| 221 | - value="1" | |
| 222 | - <?php echo !empty(wmvc_show_data('is_visible_dashboard', $db_data, ''))?'checked':''; ?>> | |
| 223 | - <?php echo __('Dashboard','wpdirectorykit'); ?> | |
| 224 | - </label> | |
| 225 | - </fieldset> | |
| 226 | - </td> | |
| 227 | - </tr> | |
| 228 | - <?php endif;?> | |
| 229 | - <tr> | |
| 230 | - <th scope="row"><label for="icon_id"><?php echo __('Icon','wpdirectorykit'); ?></label> | |
| 344 | + <th scope="row"><label for="icon_id"><?php echo esc_html__('Icon', 'wpdirectorykit'); ?></label> | |
| 231 | 345 | </th> |
| 232 | 346 | <td> |
| 233 | - <?php | |
| 234 | - echo wmvc_upload_media('icon_id', wmvc_show_data('icon_id', $db_data, '')); | |
| 347 | + <?php | |
| 348 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText | |
| 349 | + echo wmvc_upload_media('icon_id', wmvc_show_data('icon_id', $db_data, '')); | |
| 235 | 350 | ?> |
| 236 | 351 | <p class="description" id="icon_id-description"> |
| 237 | - <?php echo __('Icon used for amenities or special places on website','wpdirectorykit'); ?> | |
| 352 | + <?php echo esc_html__('Icon used for amenities or special places on website', 'wpdirectorykit'); ?> | |
| 238 | 353 | </p> |
| 239 | 354 | </td> |
| 240 | 355 | </tr> |
| 241 | 356 | <tr> |
| 242 | - <th scope="row"><label for="prefix"><?php echo __('Prefix','wpdirectorykit'); ?></label> | |
| 357 | + <th scope="row"><label for="prefix"><?php echo esc_html__('Prefix', 'wpdirectorykit'); ?></label> | |
| 243 | 358 | </th> |
| 244 | 359 | <td> |
| 245 | 360 | <input name="prefix" type="text" id="prefix" |
| 246 | - value="<?php echo wmvc_show_data('prefix', $db_data, ''); ?>" | |
| 361 | + value="<?php echo esc_attr(wmvc_show_data('prefix', $db_data, '')); ?>" | |
| 247 | 362 | class="regular-text"> |
| 248 | 363 | <p class="description" id="prefix-description"> |
| 249 | - <?php echo __('Visible before field value usable in currency like $999','wpdirectorykit'); ?> | |
| 364 | + <?php echo esc_html__('Visible before field value usable in currency like $999', 'wpdirectorykit'); ?> | |
| 250 | 365 | </p> |
| 251 | 366 | </td> |
| 252 | 367 | </tr> |
| 253 | 368 | <tr> |
| 254 | - <th scope="row"><label for="suffix"><?php echo __('Suffix','wpdirectorykit'); ?></label> | |
| 369 | + <th scope="row"><label for="suffix"><?php echo esc_html__('Suffix', 'wpdirectorykit'); ?></label> | |
| 255 | 370 | </th> |
| 256 | 371 | <td> |
| 257 | 372 | <input name="suffix" type="text" id="suffix" |
| 258 | - value="<?php echo wmvc_show_data('suffix', $db_data, ''); ?>" | |
| 373 | + value="<?php echo esc_attr(wmvc_show_data('suffix', $db_data, '')); ?>" | |
| 259 | 374 | class="regular-text"> |
| 260 | 375 | <p class="description" id="suffix-description"> |
| 261 | - <?php echo __('Visible after field value usable in metrics like 200ft','wpdirectorykit'); ?> | |
| 376 | + <?php echo esc_html__('Visible after field value usable in metrics like 200ft', 'wpdirectorykit'); ?> | |
| 262 | 377 | </p> |
| 263 | 378 | </td> |
| 264 | 379 | </tr> |
| 265 | 380 | <tr> |
| 266 | 381 | <th scope="row"><label |
| 267 | - for="values_list"><?php echo __('Values','wpdirectorykit'); ?></label></th> | |
| 382 | + for="values_list"><?php echo esc_html__('Values', 'wpdirectorykit'); ?></label></th> | |
| 268 | 383 | <td> |
| 269 | 384 | <input name="values_list" type="text" id="values_list" |
| 270 | - value="<?php echo wmvc_show_data('values_list', $db_data, ''); ?>" | |
| 385 | + value="<?php echo esc_attr(wmvc_show_data('values_list', $db_data, '')); ?>" | |
| 271 | 386 | class="regular-text"> |
| 272 | 387 | <p class="description" id="values_list-description"> |
| 273 | - <?php echo __('Values selectable in dropdown, separate with, like value1,value2,value3','wpdirectorykit'); ?> | |
| 388 | + <?php echo esc_html__('Values selectable in dropdown, separate with, like value1,value2,value3', 'wpdirectorykit'); ?> | |
| 274 | 389 | </p> |
| 275 | 390 | </td> |
| 276 | 391 | </tr> |
| 392 | + <tr> | |
| 393 | + <th scope="row"><label | |
| 394 | + for="empty_value"><?php echo esc_html__('Value when empty', 'wpdirectorykit'); ?></label></th> | |
| 395 | + <td> | |
| 396 | + <input name="empty_value" type="text" id="empty_value" | |
| 397 | + value="<?php echo esc_attr(wmvc_show_data('empty_value', $db_data, '')); ?>" | |
| 398 | + class="regular-text"> | |
| 399 | + <p class="description" id="empty_value-description"> | |
| 400 | + <?php echo esc_html__('This value will be visible if this field is not populated', 'wpdirectorykit'); ?> | |
| 401 | + </p> | |
| 402 | + </td> | |
| 403 | + </tr> | |
| 277 | 404 | </tbody> |
| 278 | 405 | </table> |
| 279 | - <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo esc_html__('Save Changes','wpdirectorykit'); ?>"> | |
| 406 | + <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo esc_attr__('Save Changes', 'wpdirectorykit'); ?>"> | |
| 280 | 407 | </form> |
| 281 | 408 | </div> |
| 282 | 409 | </div> |
| 283 | 410 | </div> |
| 284 | 411 | </div> |
| 285 | - | |
| 412 | +<?php | |
| 413 | +wp_enqueue_style('jquery-confirm'); | |
| 414 | +wp_enqueue_script('jquery-confirm'); | |
| 415 | +?> | |
| 286 | 416 | <?php $this->view('general/footer', $data); ?> |