PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 3.2.2
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v3.2.2
4.1.1 3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / views / admin / import / template / _custom_fields_template.php
wp-all-import / views / admin / import / template Last commit date
_custom_fields_template.php 11 years ago _featured_template.php 11 years ago _nested_template.php 11 years ago _other_template.php 11 years ago _taxonomies_template.php 11 years ago
_custom_fields_template.php
541 lines
1 <?php $custom_type = get_post_type_object( $post_type ); ?>
2 <div class="wpallimport-collapsed closed wpallimport-section wpallimport-custom-fields">
3 <div class="wpallimport-content-section">
4 <div class="wpallimport-collapsed-header">
5 <h3><?php _e('Custom Fields','pmxi_plugin');?></h3>
6 </div>
7 <div class="wpallimport-collapsed-content" style="padding: 0;">
8 <div class="wpallimport-collapsed-content-inner">
9 <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
10 <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import to import data to Custom Fields.', 'pmxi_plugin');?></a>
11 </div>
12 <script type="text/javascript">
13 __META_KEYS = <?php echo json_encode($meta_keys) ?>;
14 </script>
15 <?php if (empty($post['custom_name'])): ?>
16 <div class="input cf_welcome">
17 <?php if ( ! empty($meta_keys) ):?>
18 <h1 style="font-size:23px; color:#40acad;"><?php printf(__('Your website is using Custom Fields to store data for %s.', 'pmxi_plugin'), $custom_type->labels->name); ?></h1>
19 <a class="autodetect_cf auto_detect_cf" href="javascript:void(0);" rel="auto_detect_cf"><?php _e('See Detected Fields', 'pmxi_plugin'); ?></a>
20 <?php else: ?>
21 <h1 style="font-size:23px; color:#40acad;"><?php printf(__('No Custom Fields are present in your database for %s.', 'pmxi_plugin'), $custom_type->labels->name); ?></h1>
22 <p class="wpallimport-note"><?php printf(__('Manually create a %s, and fill out each field you want to import data to. WP All Import will then display these fields as available for import below.', 'pmxi_plugin'), $custom_type->labels->singular_name); ?></p>
23 <?php endif;?>
24 <a href="javascript:void(0);" class="wpallimport-dismiss-cf-welcome"><?php _e('Hide Notice', 'pmxi_plugin'); ?></a>
25 </div>
26 <div class="input cf_detect_result" style="display:none;">
27 <h1 style="font-size:23px; color:#40acad;">
28 <span class="cf_detected"></span>
29 <a class="autodetect_cf clear_detected_cf" href="javascript:void(0);" rel="clear_detected_cf"><?php _e('Clear All Fields', 'pmxi_plugin'); ?></a>
30 </h1>
31 <p class="wpallimport-note"><?php printf(__('If not all fields were detected, manually create a %s, and fill out each field you want to import data to. Then create a new import, and WP All Import will display these fields as available for import below.', 'pmxi_plugin'), $custom_type->labels->singular_name); ?></p>
32 <a href="javascript:void(0);" class="wpallimport-dismiss-cf-welcome"><?php _e('Hide Notice', 'pmxi_plugin'); ?></a>
33 </div>
34 <?php endif; ?>
35 <table class="form-table wpallimport-custom-fields-list" style="max-width:none;">
36 <tr>
37 <td colspan="3" style="padding-top:20px;">
38
39 <table class="form-table custom-params" style="max-width:none; border:none;">
40 <thead>
41 <tr>
42 <td style="padding-bottom:10px;"><?php _e('Name', 'pmxi_plugin') ?></td>
43 <td style="padding-bottom:10px;"><?php _e('Value', 'pmxi_plugin') ?></td>
44 </tr>
45 </thead>
46 <tbody>
47 <?php if (!empty($post['custom_name'])):?>
48 <?php foreach ($post['custom_name'] as $i => $name): ?>
49 <?php $custom_mapping_rules = (!empty($post['custom_mapping_rules'][$i])) ? json_decode($post['custom_mapping_rules'][$i], true) : false; ?>
50 <tr class="form-field">
51 <td style="width: 45%;">
52 <input type="text" name="custom_name[]" value="<?php echo esc_attr($name) ?>" class="widefat autocomplete" style="margin-bottom:10px;"/>
53 <input type="hidden" name="custom_format[]" value="<?php echo ( ! empty($post['custom_format'][$i]) ) ? '1' : '0'; ?>"/>
54 </td>
55 <td class="action">
56 <div class="custom_type" rel="default">
57 <textarea name="custom_value[]" class="widefat" <?php echo ( ! empty($post['custom_format'][$i]) ) ? 'style="display:none;"' : ''; ?>><?php echo esc_html($post['custom_value'][$i]) ?></textarea>
58 <a class="specify_cf pmxi_cf_pointer" rel="serialized_<?php echo $i; ?>" href="javascript:void(0);" <?php echo ( empty($post['custom_format'][$i]) ) ? 'style="display:none;"' : ''; ?>><?php _e('Click to specify', 'pmxi_plugin'); ?></a>
59 <div class="input wpallimport-custom-fields-actions">
60 <a href="javascript:void(0);" class="wpallimport-cf-options"><?php _e('Field Options...', 'pmxi_plugin'); ?></a>
61 <ul id="wpallimport-cf-menu-<?php echo $i;?>" class="wpallimport-cf-menu">
62 <li class="<?php echo ( ! empty($post['custom_format'][$i]) ) ? 'active' : ''; ?>">
63 <a href="javascript:void(0);" class="set_serialize"><?php _e('Serialized', 'pmxi_plugin'); ?></a>
64 </li>
65 <li class="<?php echo ( ! empty($custom_mapping_rules) ) ? 'active' : ''; ?>">
66 <a href="javascript:void(0);" class="set_mapping pmxi_cf_mapping" rel="cf_mapping_<?php echo $i; ?>"><?php _e('Mapping', 'pmxi_plugin'); ?></a>
67 </li>
68 </ul>
69 </div>
70 </div>
71 <div id="serialized_<?php echo $i; ?>" class="custom_type" rel="serialized" style="display:none;">
72 <fieldset>
73 <table cellpadding="0" cellspacing="5" class="cf-form-table" rel="serialized_<?php echo $i; ?>">
74 <thead>
75 <tr>
76 <td><?php _e('Key', 'pmxi_plugin') ?></td>
77 <td><?php _e('Value', 'pmxi_plugin') ?></td>
78 <td>&nbsp;</td>
79 </tr>
80 </thead>
81 <tbody>
82 <?php
83
84 $serialized_values = (!empty($post['serialized_values'][$i])) ? json_decode($post['serialized_values'][$i], true) : false;
85
86 $filtered_serialized_values = array();
87
88 if ( ! empty($serialized_values) and is_array($serialized_values))
89
90 $filtered_serialized_values = array_filter($serialized_values);
91
92 if ( ! empty($filtered_serialized_values)){
93
94 foreach ( $filtered_serialized_values as $key => $value) {
95
96 $k = $key;
97
98 if (is_array($value)){
99 $keys = array_keys($value);
100 $k = $keys[0];
101 }
102
103 ?>
104 <tr class="form-field">
105 <td>
106 <input type="text" class="serialized_key widefat" value="<?php echo $k; ?>">
107 </td>
108 <td>
109 <input type="text" class="serialized_value widefat" value="<?php echo esc_html((is_array($value)) ? $value[$k] : $value); ?>">
110 </td>
111 <td class="action remove">
112 <a href="#remove" style="right:-10px;"></a>
113 </td>
114 </tr>
115 <?php
116 }
117 }
118 else{
119 ?>
120 <tr class="form-field">
121 <td>
122 <input type="text" class="serialized_key widefat">
123 </td>
124 <td>
125 <input type="text" class="serialized_value widefat">
126 </td>
127 <td class="action remove">
128 <a href="#remove" style="right:-10px;"></a>
129 </td>
130 </tr>
131 <?php
132 }
133 ?>
134 <tr class="form-field template">
135 <td>
136 <input type="text" class="serialized_key widefat">
137 </td>
138 <td>
139 <input type="text" class="serialized_value widefat">
140 </td>
141 <td class="action remove">
142 <a href="#remove" style="right:-10px;"></a>
143 </td>
144 </tr>
145 <tr>
146 <td colspan="3">
147 <a href="javascript:void(0);" title="<?php _e('Add Custom Field', 'pmxi_plugin')?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
148 </td>
149 </tr>
150 <tr>
151 <td>
152 <div class="wrap" style="position:relative;">
153 <a class="save_popup auto_detect_sf" href="javascript:void(0);"><?php _e('Auto-Detect', 'pmxi_plugin'); ?></a>
154 </div>
155 </td>
156 <td colspan="2">
157 <div class="wrap" style="position:relative;">
158 <a class="save_popup save_sf" href="javascript:void(0);"><?php _e('Save', 'pmxi_plugin'); ?></a>
159 </div>
160 </td>
161 </tr>
162 </tbody>
163 </table>
164 <input type="hidden" name="serialized_values[]" value="<?php if (!empty($post['serialized_values'][$i])) echo esc_html($post['serialized_values'][$i]); ?>"/>
165 </fieldset>
166 </div>
167
168 <div id="cf_mapping_<?php echo $i; ?>" class="custom_type" rel="mapping" style="display:none;">
169 <fieldset>
170 <table cellpadding="0" cellspacing="5" class="cf-form-table" rel="cf_mapping_<?php echo $i; ?>">
171 <thead>
172 <tr>
173 <td><?php _e('In Your File', 'pmxi_plugin') ?></td>
174 <td><?php _e('Translated To', 'pmxi_plugin') ?></td>
175 <td>&nbsp;</td>
176 </tr>
177 </thead>
178 <tbody>
179 <?php
180
181 if ( ! empty($custom_mapping_rules) and is_array($custom_mapping_rules)){
182
183 foreach ($custom_mapping_rules as $key => $value) {
184
185 $k = $key;
186
187 if (is_array($value)){
188 $keys = array_keys($value);
189 $k = $keys[0];
190 }
191
192 ?>
193 <tr class="form-field">
194 <td>
195 <input type="text" class="mapping_from widefat" value="<?php echo $k; ?>">
196 </td>
197 <td>
198 <input type="text" class="mapping_to widefat" value="<?php echo (is_array($value)) ? $value[$k] : $value; ?>">
199 </td>
200 <td class="action remove">
201 <a href="#remove" style="right:-10px;"></a>
202 </td>
203 </tr>
204 <?php
205 }
206 }
207 else{
208 ?>
209 <tr class="form-field">
210 <td>
211 <input type="text" class="mapping_from widefat">
212 </td>
213 <td>
214 <input type="text" class="mapping_to widefat">
215 </td>
216 <td class="action remove">
217 <a href="#remove" style="right:-10px;"></a>
218 </td>
219 </tr>
220 <?php
221 }
222 ?>
223 <tr class="form-field template">
224 <td>
225 <input type="text" class="mapping_from widefat">
226 </td>
227 <td>
228 <input type="text" class="mapping_to widefat">
229 </td>
230 <td class="action remove">
231 <a href="#remove" style="right:-10px;"></a>
232 </td>
233 </tr>
234 <tr>
235 <td colspan="3">
236 <a href="javascript:void(0);" title="<?php _e('Add Another', 'pmxi_plugin')?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
237 </td>
238 </tr>
239 <tr>
240 <td colspan="3">
241 <div class="wrap" style="position:relative;">
242 <a class="save_popup save_mr" href="javascript:void(0);"><?php _e('Save Rules', 'pmxi_plugin'); ?></a>
243 </div>
244 </td>
245 </tr>
246 </tbody>
247 </table>
248 <input type="hidden" name="custom_mapping_rules[]" value="<?php if (!empty($custom_mapping_rules)) echo esc_html($post['custom_mapping_rules'][$i]); ?>"/>
249 </fieldset>
250 </div>
251
252 <span class="action remove">
253 <a href="#remove" style="top: 8px; right: 0;"></a>
254 </span>
255 </td>
256 </tr>
257 <?php endforeach ?>
258 <?php else: ?>
259 <tr class="form-field">
260 <td style="width: 45%;">
261 <input type="text" name="custom_name[]" value="" class="widefat autocomplete" style="margin-bottom:10px;"/>
262 <input type="hidden" name="custom_format[]" value="0"/>
263 </td>
264 <td class="action">
265 <div class="custom_type" rel="default">
266 <textarea name="custom_value[]" class="widefat"></textarea>
267 <a class="specify_cf pmxi_cf_pointer" rel="serialized_0" href="javascript:void(0);" style="display:none;"><?php _e('Click to specify', 'pmxi_plugin'); ?></a>
268 <div class="input wpallimport-custom-fields-actions">
269 <a href="javascript:void(0);" class="wpallimport-cf-options"><?php _e('Field Options...', 'pmxi_plugin'); ?></a>
270 <ul id="wpallimport-cf-menu-0" class="wpallimport-cf-menu">
271 <li>
272 <a href="javascript:void(0);" class="set_serialize"><?php _e('Serialized', 'pmxi_plugin'); ?></a>
273 </li>
274 <li>
275 <a href="javascript:void(0);" class="set_mapping pmxi_cf_mapping" rel="cf_mapping_0"><?php _e('Mapping', 'pmxi_plugin'); ?></a>
276 </li>
277 </ul>
278 </div>
279 </div>
280 <div id="serialized_0" class="custom_type" rel="serialized" style="display:none;">
281 <fieldset>
282 <table cellpadding="0" cellspacing="5" class="cf-form-table" rel="serialized_0">
283 <thead>
284 <tr>
285 <td><?php _e('Key', 'pmxi_plugin') ?></td>
286 <td><?php _e('Value', 'pmxi_plugin') ?></td>
287 <td>&nbsp;</td>
288 </tr>
289 </thead>
290 <tbody>
291 <tr class="form-field">
292 <td>
293 <input type="text" class="serialized_key widefat" value="">
294 </td>
295 <td>
296 <input type="text" class="serialized_value widefat" value="">
297 </td>
298 <td class="action remove">
299 <a href="#remove" style="right:-10px;"></a>
300 </td>
301 </tr>
302 <tr class="form-field template">
303 <td>
304 <input type="text" class="serialized_key widefat" value="">
305 </td>
306 <td>
307 <input type="text" class="serialized_value widefat" value="">
308 </td>
309 <td class="action remove">
310 <a href="#remove" style="right:-10px;"></a>
311 </td>
312 </tr>
313 <tr>
314 <td colspan="3">
315 <a href="javascript:void(0);" title="<?php _e('Add Another', 'pmxi_plugin')?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
316 </td>
317 </tr>
318 <tr>
319 <td>
320 <div class="wrap" style="position:relative;">
321 <a class="save_popup auto_detect_sf" href="javascript:void(0);"><?php _e('Auto-Detect', 'pmxi_plugin'); ?></a>
322 </div>
323 </td>
324 <td colspan="2">
325 <div class="wrap" style="position:relative;">
326 <a class="save_popup save_sf" href="javascript:void(0);"><?php _e('Save', 'pmxi_plugin'); ?></a>
327 </div>
328 </td>
329 </tr>
330 </tbody>
331 </table>
332 <input type="hidden" name="serialized_values[]" value=""/>
333 </fieldset>
334 </div>
335
336 <div id="cf_mapping_0" class="custom_type" rel="mapping" style="display:none;">
337 <fieldset>
338 <table cellpadding="0" cellspacing="5" class="cf-form-table" rel="cf_mapping_0">
339 <thead>
340 <tr>
341 <td><?php _e('In Your File', 'pmxi_plugin') ?></td>
342 <td><?php _e('Translated To', 'pmxi_plugin') ?></td>
343 <td>&nbsp;</td>
344 </tr>
345 </thead>
346 <tbody>
347 <tr class="form-field">
348 <td>
349 <input type="text" class="mapping_from widefat" value="">
350 </td>
351 <td>
352 <input type="text" class="mapping_to widefat" value="">
353 </td>
354 <td class="action remove">
355 <a href="#remove" style="right:-10px;"></a>
356 </td>
357 </tr>
358 <tr class="form-field template">
359 <td>
360 <input type="text" class="mapping_from widefat" value="">
361 </td>
362 <td>
363 <input type="text" class="mapping_to widefat" value="">
364 </td>
365 <td class="action remove">
366 <a href="#remove" style="right:-10px;"></a>
367 </td>
368 </tr>
369 <tr>
370 <td colspan="3">
371 <a href="javascript:void(0);" title="<?php _e('Add Another', 'pmxi_plugin')?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
372 </td>
373 </tr>
374 <tr>
375 <td colspan="3">
376 <div class="wrap" style="position:relative;">
377 <a class="save_popup save_mr" href="javascript:void(0);"><?php _e('Save Rules', 'pmxi_plugin'); ?></a>
378 </div>
379 </td>
380 </tr>
381 </tbody>
382 </table>
383 <input type="hidden" name="custom_mapping_rules[]" value=""/>
384 </fieldset>
385 </div>
386
387 <span class="action remove">
388 <a href="#remove" style="top: 8px; right: 0;"></a>
389 </span>
390 </td>
391 </tr>
392 <?php endif;?>
393 <tr class="form-field template">
394 <td style="width: 45%;">
395 <input type="text" name="custom_name[]" value="" class="widefat autocomplete" style="margin-bottom:10px;"/>
396 <input type="hidden" name="custom_format[]" value="0"/>
397 </td>
398 <td class="action">
399 <div class="custom_type" rel="default">
400 <textarea name="custom_value[]" class="widefat"></textarea>
401 <a class="specify_cf pmxi_cf_pointer" href="javascript:void(0);" style="display:none;"><?php _e('Click to specify', 'pmxi_plugin'); ?></a>
402 <div class="input wpallimport-custom-fields-actions">
403 <a href="javascript:void(0);" class="wpallimport-cf-options"><?php _e('Field Options...', 'pmxi_plugin'); ?></a>
404 <ul class="wpallimport-cf-menu">
405 <li>
406 <a href="javascript:void(0);" class="set_serialize"><?php _e('Serialized', 'pmxi_plugin'); ?></a>
407 </li>
408 <li>
409 <a href="javascript:void(0);" class="set_mapping pmxi_cf_mapping"><?php _e('Mapping', 'pmxi_plugin'); ?></a>
410 </li>
411 </ul>
412 </div>
413 </div>
414 <div class="custom_type" rel="serialized" style="display:none;">
415 <fieldset>
416 <table cellpadding="0" cellspacing="5" class="cf-form-table">
417 <thead>
418 <tr>
419 <td><?php _e('Key', 'pmxi_plugin') ?></td>
420 <td><?php _e('Value', 'pmxi_plugin') ?></td>
421 <td>&nbsp;</td>
422 </tr>
423 </thead>
424 <tbody>
425 <tr class="form-field">
426 <td>
427 <input type="text" class="serialized_key widefat">
428 </td>
429 <td>
430 <input type="text" class="serialized_value widefat">
431 </td>
432 <td class="action remove">
433 <a href="#remove" style="right:-10px;"></a>
434 </td>
435 </tr>
436 <tr class="form-field template">
437 <td>
438 <input type="text" class="serialized_key widefat">
439 </td>
440 <td>
441 <input type="text" class="serialized_value widefat">
442 </td>
443 <td class="action remove">
444 <a href="#remove" style="right:-10px;"></a>
445 </td>
446 </tr>
447 <tr>
448 <td colspan="3">
449 <a href="javascript:void(0);" title="<?php _e('Add Another', 'pmxi_plugin'); ?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
450 </td>
451 </tr>
452 <tr>
453 <td>
454 <div class="wrap" style="position:relative;">
455 <a class="save_popup auto_detect_sf" href="javascript:void(0);"><?php _e('Auto-Detect', 'pmxi_plugin'); ?></a>
456 </div>
457 </td>
458 <td colspan="2">
459 <div class="wrap" style="position:relative;">
460 <a class="save_popup save_sf" href="javascript:void(0);"><?php _e('Save', 'pmxi_plugin'); ?></a>
461 </div>
462 </td>
463 </tr>
464 </tbody>
465 </table>
466 <input type="hidden" name="serialized_values[]" value=""/>
467 </fieldset>
468 </div>
469
470 <div class="custom_type" rel="mapping" style="display:none;">
471 <fieldset>
472 <table cellpadding="0" cellspacing="5" class="cf-form-table">
473 <thead>
474 <tr>
475 <td><?php _e('In Your File', 'pmxi_plugin') ?></td>
476 <td><?php _e('Translated To', 'pmxi_plugin') ?></td>
477 <td>&nbsp;</td>
478 </tr>
479 </thead>
480 <tbody>
481 <tr class="form-field">
482 <td>
483 <input type="text" class="mapping_from widefat">
484 </td>
485 <td>
486 <input type="text" class="mapping_to widefat">
487 </td>
488 <td class="action remove">
489 <a href="#remove" style="right:-10px;"></a>
490 </td>
491 </tr>
492 <tr class="form-field template">
493 <td>
494 <input type="text" class="mapping_from widefat">
495 </td>
496 <td>
497 <input type="text" class="mapping_to widefat">
498 </td>
499 <td class="action remove">
500 <a href="#remove" style="right:-10px;"></a>
501 </td>
502 </tr>
503 <tr>
504 <td colspan="3">
505 <a href="javascript:void(0);" title="<?php _e('Add Another', 'pmxi_plugin')?>" class="action add-new-key add-new-entry"><?php _e('Add Another', 'pmxi_plugin') ?></a>
506 </td>
507 </tr>
508 <tr>
509 <td colspan="3">
510 <div class="wrap" style="position:relative;">
511 <a class="save_popup save_mr" href="javascript:void(0);"><?php _e('Save Rules', 'pmxi_plugin'); ?></a>
512 </div>
513 </td>
514 </tr>
515 </tbody>
516 </table>
517 <input type="hidden" name="custom_mapping_rules[]" value=""/>
518 </fieldset>
519 </div>
520
521 <span class="action remove">
522 <a href="#remove" style="top: 8px; right: 0;"></a>
523 </span>
524 </td>
525 </tr>
526 <tr>
527 <td colspan="2"><a href="javascript:void(0);" title="<?php _e('Add Custom Field', 'pmxi_plugin')?>" class="action add-new-custom add-new-entry"><?php _e('Add Custom Field', 'pmxi_plugin') ?></a></td>
528 </tr>
529 </tbody>
530 </table>
531
532 <input type="hidden" id="existing_meta_keys" value="<?php echo implode(',', $meta_keys); ?>"/>
533
534 </td>
535 </tr>
536 </table>
537 </div>
538 </div>
539 </div>
540 </div>
541 <div class="wpallimport-overlay"></div>