PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | application/views/wdk_fields/index.php +34 -16 1.2.5 → 1.5.9 View file →
@@ -13,10 +13,10 @@
13 13
14 14 <!-- This file should primarily consist of HTML with a little bit of PHP. -->
15 15
16 16 <div class="wrap wdk-wrap">
17 - <h1 class="wp-heading-inline"><?php echo __('Directory Fields Management','wpdirectorykit'); ?> <a href="<?php echo get_admin_url() . "admin.php?page=wdk_fields&function=field_edit"; ?>" class="button button-primary" id="add_field_button"><?php echo __('Add Field','wpdirectorykit'); ?></a></h1>
18 - <br /><br />
17 + <h1 class="wp-heading-inline"><?php echo esc_html__('Directory Fields Management','wpdirectorykit'); ?> <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_fields&function=field_edit"); ?>" class="button button-primary" id="add_field_button"><?php echo esc_html__('Add Field','wpdirectorykit'); ?></a></h1>
18 + <br />
19 19 <div class="wdk-body ">
20 20 <div class="row fields_list">
21 21 <?php if(count($fields) == 0): ?>
22 22 <?php if(!function_exists('eli_installer') || !function_exists('run_elementinvader') || !is_plugin_active('elementor/elementor.php')):?>
@@ -30,11 +30,11 @@
30 30 ?>
31 31
32 32 <div class="notice notice-error">
33 33 <p>
34 - <?php echo __('First please install / activate required plugins, then you can import demo data','wpdirectorykit'); ?>
34 + <?php echo esc_html__('First please install / activate required plugins, then you can import demo data','wpdirectorykit'); ?>
35 35 <a href="<?php echo esc_url($tgma_link); ?>" class="button button-primary">
36 - <?php echo __('Begin to install / activate','wpdirectorykit'); ?>
36 + <?php echo esc_html__('Begin to install / activate','wpdirectorykit'); ?>
37 37 </a>
38 38 </p>
39 39 </div>
40 40 <?php else:?>
@@ -54,12 +54,16 @@
54 54 }
55 55 }
56 56 }
57 57 ksort($multipurpose_values);
58 +
59 +
60 + if(has_filter('wdk/settings/import/multipurpose_values'))
61 + $multipurpose_values = apply_filters('wdk/settings/import/multipurpose_values', $multipurpose_values);
58 62 ?>
59 63 <div class="notice notice-success">
60 64 <p>
61 - <?php echo __('You don\'t have any fields, import demo data for','wpdirectorykit'); ?>
65 + <?php echo esc_html__('You don\'t have any fields, import demo data for','wpdirectorykit'); ?>
62 66 <select name="multipurpose" class="field_purpose align-top text-capitalize">
63 67 <?php foreach ($multipurpose_values as $purpose_key => $purpose) :?>
64 68 <?php
65 69 $selected = '';
@@ -68,10 +72,10 @@
68 72 ?>
69 73 <option value="<?php echo esc_attr($purpose_key);?>" <?php echo esc_html($selected);?>><?php echo esc_html(ucwords($purpose));?></option>
70 74 <?php endforeach;?>
71 75 </select>
72 - <a href="<?php echo get_admin_url() . "admin.php?page=wdk_settings&function=run&multipurpose=real-estate.xml&redirect_url=admin.php?page=wdk_fields&_wpnonce=".wp_create_nonce( 'wdk-import-data-run'); ?>" class="button button-primary event-ajax-indicator" id="import_demo_field_button">
73 - <?php echo __('Click here to import now','wpdirectorykit'); ?>
76 + <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=run&multipurpose=real-estate.xml&redirect_url=admin.php?page=wdk_fields&_wpnonce=".wp_create_nonce( 'wdk-import-data-run')); ?>" class="button button-primary event-ajax-indicator" id="import_demo_field_button">
77 + <?php echo esc_html__('Click here to import now','wpdirectorykit'); ?>
74 78 </a>
75 79 <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 6px;margin-left: 4px;"></span>
76 80 </p>
77 81 </div>
@@ -78,9 +82,9 @@
78 82 <?php endif; ?>
79 83 <?php endif; ?>
80 84 <?php
81 85 if (isset($_GET['message'])) {
82 - echo '<p class="alert alert-success">' .str_replace("+", ' ', sanitize_text_field($_GET['message'])) . '</p><br/>';
86 + echo '<p class="alert alert-success">' .esc_html(str_replace("+", ' ', wp_kses_post(urldecode($_GET['message'])))) . '</p><br/>';
83 87 }
84 88 ?>
85 89
86 90 <div id="wdk-sortable-fields" class="meta-box-sortables ui-sortable wdk-row">
@@ -86,11 +90,11 @@
86 90 <div id="wdk-sortable-fields" class="meta-box-sortables ui-sortable wdk-row">
87 91 <?php foreach($fields as $field): ?>
88 92 <div id="fid_<?php echo esc_attr($field->idfield); ?>" class=" wdk_field wdk-col-md-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->field_type); ?>" rel="<?php echo esc_attr($field->idfield); ?>">
89 93 <div class="postbox-header postbox ">
90 - <h3 class="hndle ui-sortable-handle"> <a href="<?php echo get_admin_url() . "admin.php?page=wdk_fields&function=field_edit&id=".esc_attr($field->idfield); ?>">#<?php echo esc_html($field->idfield); ?> <?php echo esc_html($field->field_label); ?> <?php echo !empty(wmvc_show_data('is_required', $field, ''))?'*':''; ?> [<?php echo esc_html($field->field_type); ?>]</a>
91 - <a class="question_sure pull_right" href="<?php echo get_admin_url() . "admin.php?page=wdk_fields&function=delete&id=".esc_attr($field->idfield); ?>&_wpnonce=<?php echo wp_create_nonce( 'wdk-fields-delete_'.esc_attr($field->idfield));?>" title="<?php echo esc_attr__('Remove','wpdirectorykit');?>"><span class="dashicons dashicons-no"></span></a>
92 - <a class="pull_right" href="<?php echo get_admin_url() . "admin.php?page=wdk_fields&function=field_edit&id=".esc_attr($field->idfield); ?>" title="<?php echo esc_attr__('Edit','wpdirectorykit');?>"><span class="dashicons dashicons-edit"></span></a>
94 + <h3 class="hndle ui-sortable-handle"> <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_fields&function=field_edit&id=".esc_attr($field->idfield)); ?>">#<?php echo esc_html($field->idfield); ?> <?php echo esc_html($field->field_label); ?> <?php echo !empty(wmvc_show_data('is_required', $field, ''))?'*':''; ?> [<?php echo esc_html($field->field_type); ?>]</a>
95 + <a class="question_sure pull_right" href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_fields&function=delete&id=".esc_attr($field->idfield)); ?>&_wpnonce=<?php echo esc_attr(wp_create_nonce( 'wdk-fields-delete_'.esc_attr($field->idfield)));?>" title="<?php echo esc_attr__('Remove','wpdirectorykit');?>"><span class="dashicons dashicons-no"></span></a>
96 + <a class="pull_right" href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_fields&function=field_edit&id=".esc_attr($field->idfield)); ?>" title="<?php echo esc_attr__('Edit','wpdirectorykit');?>"><span class="dashicons dashicons-edit"></span></a>
93 97 </h3>
94 98 <?php if(false): ?>
95 99 <div class="handle-actions hide-if-no-js">
96 100 <button type="button" class="handle-order-higher" aria-disabled="false" aria-describedby="postimagediv-handle-order-higher-description">
@@ -116,9 +120,24 @@
116 120 </div>
117 121 <?php endforeach; ?>
118 122 </div>
119 123
120 - <div class="alert alert-info" style="margin-bottom:20px" role="alert"><?php echo sprintf(__('%1$s This fields and section can be restructured, replaced/moved with drag & drop, resized etc. How to add new feilds?%2$s', 'wpdirectorykit'),'<a href="//wpdirectorykit.com/documentation/#!/custom_fields" target="_blank">','</a>'); ?></div>
124 + <div class="alert alert-info" style="margin-bottom:20px" role="alert"><?php
125 + echo wp_kses(
126 + sprintf(
127 + /* translators: 1: Tag with link open, 2: close link tag. */
128 + __('%1$s This fields and section can be restructured, replaced/moved with drag & drop, resized etc. How to add new fields?%2$s', 'wpdirectorykit'),
129 + '<a href="' . esc_url('https://wpdirectorykit.com/documentation/#!/custom_fields') . '" target="_blank">',
130 + '</a>'
131 + ),
132 + array(
133 + 'a' => array(
134 + 'href' => true,
135 + 'target' => true,
136 + ),
137 + )
138 + );
139 + ?></div>
121 140 <iframe width="560" height="315" src="//www.youtube.com/embed/cewZBOGzbPg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
122 141 </div>
123 142 </div>
124 143 </div>
@@ -135,9 +154,9 @@
135 154 // Generate table
136 155 jQuery(document).ready(function($) {
137 156
138 157 $('.field_purpose').on('change', function(){
139 - $('#import_demo_field_button').attr('href', '<?php echo get_admin_url() . "admin.php?page=wdk_settings&function=run&redirect_url=admin.php?page=wdk_fields&_wpnonce=".wp_create_nonce( 'wdk-import-data-run'); ?>&multipurpose='+$(this).find(":selected").attr('value'))
158 + $('#import_demo_field_button').attr('href', '<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=run&redirect_url=admin.php?page=wdk_fields&_wpnonce=".wp_create_nonce( 'wdk-import-data-run')); ?>&multipurpose='+$(this).find(":selected").attr('value'))
140 159 });
141 160
142 161 $( "#wdk-sortable-fields" ).sortable({
143 162 update: function(event, ui) {
@@ -147,15 +166,14 @@
147 166 $('#wdk-sortable-fields .wdk_field').each(function( index ) {
148 167 data_fields_list+=$( this ).attr('rel')+';';
149 168 });
150 169
151 - //console.log(data_fields_list);
152 -
153 170 var data = {
154 171 'page': 'wdk_fields',
155 172 'function': 'ajax_save_order',
156 173 'action': 'wdk_admin_action',
157 - 'data_fields_list' : data_fields_list
174 + 'data_fields_list' : data_fields_list,
175 + 'wdk_fields_nonce' : '<?php echo esc_js(wp_create_nonce('wdk_fields_save_order')); ?>'
158 176 };
159 177
160 178 $.post( "<?php echo esc_url(admin_url( 'admin-ajax.php' )); ?>", data)
161 179 .done(function( data ) {