Version Description
- security improvement
- improvement: changed Manage Imports page button labels to be more precise
- improvement: assign 'Uncategorized' term to posts imported without a category assigned
- improvement: add support for taxonomies that return objects instead of IDs
- improvement: remove commented code that could cause false positives for security scans
- bug fix: jQuery error related to 'destroy' method
- bug fix: rare issue that prevented content image URLs from being updated during import
- bug fix: taxonomies section drag and drop doesn't save after rearranging fields
- bug fix: conflict with Advanced Ads plugin
- bug fix: 'Instead of deletion, set missing records to out of stock' still deleting products
Download this release
Release Info
Developer | soflyy |
Plugin | Import any XML or CSV File to WordPress |
Version | 3.6.7 |
Comparing to | |
See all releases |
Code changes from version 3.6.6 to 3.6.7
- actions/wp_ajax_delete_import.php +4 -4
- classes/PHPExcel/Shared/PCLZip/pclzip.lib.php +0 -10
- controllers/admin/history.php +7 -7
- controllers/admin/import.php +19 -19
- controllers/admin/manage.php +13 -13
- controllers/admin/settings.php +6 -6
- filters/wp_all_import_set_post_terms.php +18 -0
- models/import/record.php +47 -68
- plugin.php +3 -3
- readme.txt +14 -2
- static/js/admin.js +83 -83
- static/js/jquery/jquery.ui-contextmenu.min.js +1 -1
- views/admin/import/options/_reimport_options.php +49 -48
- views/admin/import/template.php +69 -69
- views/admin/manage/index.php +27 -27
actions/wp_ajax_delete_import.php
CHANGED
@@ -53,13 +53,13 @@ function pmxi_wp_ajax_delete_import(){
|
|
53 |
}
|
54 |
|
55 |
if ( $params['is_delete_import'] and ! $params['is_delete_posts'] ) {
|
56 |
-
$response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Import deleted', 'wp_all_import_plugin')), $params['base_url']);
|
57 |
} elseif( ! $params['is_delete_import'] and $params['is_delete_posts']) {
|
58 |
-
$response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('All associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
|
59 |
} elseif( $params['is_delete_import'] and $params['is_delete_posts']) {
|
60 |
-
$response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('Import and all associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
|
61 |
} else {
|
62 |
-
$response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $params['base_url']);
|
63 |
exit( json_encode( $response ));
|
64 |
}
|
65 |
|
53 |
}
|
54 |
|
55 |
if ( $params['is_delete_import'] and ! $params['is_delete_posts'] ) {
|
56 |
+
$response['redirect'] = esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('Import deleted', 'wp_all_import_plugin')), $params['base_url']));
|
57 |
} elseif( ! $params['is_delete_import'] and $params['is_delete_posts']) {
|
58 |
+
$response['redirect'] = esc_url_raw(add_query_arg('pmxi_nt', urlencode(sprintf(__('All associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']));
|
59 |
} elseif( $params['is_delete_import'] and $params['is_delete_posts']) {
|
60 |
+
$response['redirect'] = esc_url_raw(add_query_arg('pmxi_nt', urlencode(sprintf(__('Import and all associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']));
|
61 |
} else {
|
62 |
+
$response['redirect'] = esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $params['base_url']));
|
63 |
exit( json_encode( $response ));
|
64 |
}
|
65 |
|
classes/PHPExcel/Shared/PCLZip/pclzip.lib.php
CHANGED
@@ -4850,11 +4850,6 @@ class PclZip
|
|
4850 |
// ----- Get and memorize the magic_quote value
|
4851 |
$this->magic_quotes_status = @get_magic_quotes_runtime();
|
4852 |
|
4853 |
-
// ----- Disable magic_quotes
|
4854 |
-
// if ($this->magic_quotes_status == 1) {
|
4855 |
-
// @set_magic_quotes_runtime(0);
|
4856 |
-
// }
|
4857 |
-
|
4858 |
// ----- Return
|
4859 |
return $v_result;
|
4860 |
}
|
@@ -4880,11 +4875,6 @@ class PclZip
|
|
4880 |
return $v_result;
|
4881 |
}
|
4882 |
|
4883 |
-
// ----- Swap back magic_quotes
|
4884 |
-
// if ($this->magic_quotes_status == 1) {
|
4885 |
-
// @set_magic_quotes_runtime($this->magic_quotes_status);
|
4886 |
-
// }
|
4887 |
-
|
4888 |
// ----- Return
|
4889 |
return $v_result;
|
4890 |
}
|
4850 |
// ----- Get and memorize the magic_quote value
|
4851 |
$this->magic_quotes_status = @get_magic_quotes_runtime();
|
4852 |
|
|
|
|
|
|
|
|
|
|
|
4853 |
// ----- Return
|
4854 |
return $v_result;
|
4855 |
}
|
4875 |
return $v_result;
|
4876 |
}
|
4877 |
|
|
|
|
|
|
|
|
|
|
|
4878 |
// ----- Return
|
4879 |
return $v_result;
|
4880 |
}
|
controllers/admin/history.php
CHANGED
@@ -28,7 +28,7 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
28 |
$get['id'] = absint($get['id']);
|
29 |
extract($get);
|
30 |
if (empty($id)){
|
31 |
-
wp_redirect(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode(__('Import is not specified.', 'wp_all_import_plugin'))), $this->baseUrl)); die();
|
32 |
}
|
33 |
$this->data += $get;
|
34 |
|
@@ -52,7 +52,7 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
52 |
)->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
|
53 |
|
54 |
$this->data['page_links'] = paginate_links(array(
|
55 |
-
'base' => add_query_arg(array('id' => $id, 'pagenum' => '%#%')
|
56 |
'format' => '',
|
57 |
'prev_text' => __('«', 'wp_all_import_plugin'),
|
58 |
'next_text' => __('»', 'wp_all_import_plugin'),
|
@@ -89,7 +89,7 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
89 |
else
|
90 |
{
|
91 |
|
92 |
-
wp_redirect(add_query_arg(array('id' => $import_id, 'pmxi_nt' => urlencode(__('Log file does not exist.', 'wp_all_import_plugin'))), $this->baseUrl)); die();
|
93 |
}
|
94 |
}
|
95 |
}
|
@@ -106,10 +106,10 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
106 |
$id = $this->input->get('id');
|
107 |
$this->data['item'] = $item = new PMXI_History_Record();
|
108 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
109 |
-
wp_redirect($this->baseUrl); die();
|
110 |
}
|
111 |
$item->delete();
|
112 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(__('History deleted', 'wp_all_import_plugin')), $this->baseUrl)); die();
|
113 |
}
|
114 |
|
115 |
}
|
@@ -127,7 +127,7 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
127 |
$this->data['ids'] = $ids = $this->input->post('items');
|
128 |
$this->data['items'] = $items = new PMXI_History_List();
|
129 |
if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
|
130 |
-
wp_redirect($this->baseUrl); die();
|
131 |
}
|
132 |
|
133 |
foreach($items->convertRecords() as $item) {
|
@@ -136,7 +136,7 @@ class PMXI_Admin_History extends PMXI_Controller_Admin {
|
|
136 |
|
137 |
$id = $this->input->get('id');
|
138 |
|
139 |
-
wp_redirect(add_query_arg(array('id' => $id, 'pmxi_nt' => urlencode(sprintf(__('%d %s deleted', 'wp_all_import_plugin'), $items->count(), _n('history', 'histories', $items->count(), 'wp_all_import_plugin')))), $this->baseUrl)); die();
|
140 |
|
141 |
}
|
142 |
}
|
28 |
$get['id'] = absint($get['id']);
|
29 |
extract($get);
|
30 |
if (empty($id)){
|
31 |
+
wp_redirect(esc_url_raw(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode(__('Import is not specified.', 'wp_all_import_plugin'))), $this->baseUrl))); die();
|
32 |
}
|
33 |
$this->data += $get;
|
34 |
|
52 |
)->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
|
53 |
|
54 |
$this->data['page_links'] = paginate_links(array(
|
55 |
+
'base' => add_query_arg(array('id' => $id, 'pagenum' => '%#%'),$this->baseUrl),
|
56 |
'format' => '',
|
57 |
'prev_text' => __('«', 'wp_all_import_plugin'),
|
58 |
'next_text' => __('»', 'wp_all_import_plugin'),
|
89 |
else
|
90 |
{
|
91 |
|
92 |
+
wp_redirect(esc_url_raw(add_query_arg(array('id' => $import_id, 'pmxi_nt' => urlencode(__('Log file does not exist.', 'wp_all_import_plugin'))), $this->baseUrl))); die();
|
93 |
}
|
94 |
}
|
95 |
}
|
106 |
$id = $this->input->get('id');
|
107 |
$this->data['item'] = $item = new PMXI_History_Record();
|
108 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
109 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
110 |
}
|
111 |
$item->delete();
|
112 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('History deleted', 'wp_all_import_plugin')), $this->baseUrl))); die();
|
113 |
}
|
114 |
|
115 |
}
|
127 |
$this->data['ids'] = $ids = $this->input->post('items');
|
128 |
$this->data['items'] = $items = new PMXI_History_List();
|
129 |
if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
|
130 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
131 |
}
|
132 |
|
133 |
foreach($items->convertRecords() as $item) {
|
136 |
|
137 |
$id = $this->input->get('id');
|
138 |
|
139 |
+
wp_redirect(esc_url_raw(add_query_arg(array('id' => $id, 'pmxi_nt' => urlencode(sprintf(__('%d %s deleted', 'wp_all_import_plugin'), $items->count(), _n('history', 'histories', $items->count(), 'wp_all_import_plugin')))), $this->baseUrl))); die();
|
140 |
|
141 |
}
|
142 |
}
|
controllers/admin/import.php
CHANGED
@@ -16,7 +16,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
16 |
$id = $this->input->get('id');
|
17 |
$this->data['import'] = $import = new PMXI_Import_Record();
|
18 |
if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
|
19 |
-
wp_redirect(add_query_arg('page', 'pmxi-admin-manage', admin_url('admin.php'))); die();
|
20 |
}
|
21 |
$this->isWizard = false;
|
22 |
|
@@ -70,7 +70,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
70 |
) {
|
71 |
if ( ! PMXI_Plugin::is_ajax() ){
|
72 |
$this->errors->add('form-validation', __('WP All Import lost track of where you are.<br/><br/>Maybe you cleared your cookies or maybe it is just a temporary issue on your or your web host\'s end.', 'wp_all_import_plugin'));
|
73 |
-
wp_redirect_or_javascript($this->baseUrl); die();
|
74 |
}
|
75 |
}
|
76 |
|
@@ -87,19 +87,19 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
87 |
|
88 |
if ( ! PMXI_Plugin::$session->get('xpath', false) or empty($elements) or ! $elements->length) {
|
89 |
$this->errors->add('form-validation', __('There are no elements to import based on your XPath.<br/><br/>If you are in Step 2, you probably specified filtering options that don’t match any elements present in your file.<br/>If you are seeing this error elsewhere, it means that while the XPath expression for your initial import matched some elements in your file previously, there are now zero elements in the file that match this expression.<br/>You can edit the XPath for your import by going to the Manage Imports -> Import Settings page.', 'wp_all_import_plugin'));
|
90 |
-
wp_redirect_or_javascript(add_query_arg('action', 'element', $this->baseUrl)); die();
|
91 |
}
|
92 |
|
93 |
if ('template' == $action or 'preview' == $action or 'tag' == $action) return true;
|
94 |
|
95 |
// step #4: options
|
96 |
if ( empty( PMXI_Plugin::$session->options ) ) {
|
97 |
-
wp_redirect_or_javascript(add_query_arg('action', 'template', $this->baseUrl)); die();
|
98 |
}
|
99 |
if ('options' == $action) return true;
|
100 |
|
101 |
if ( empty( PMXI_Plugin::$session->options ) ) {
|
102 |
-
wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
|
103 |
}
|
104 |
}
|
105 |
|
@@ -151,9 +151,9 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
151 |
if ( $id ) { // update requested but corresponding import is not found
|
152 |
if ( $import->getById($id)->isEmpty() ) {
|
153 |
if ( ! empty($_GET['deligate']) and sanitize_key($_GET['deligate']) == 'wpallexport' ) {
|
154 |
-
wp_redirect(add_query_arg('pmxi_nt', array('error' => urlencode(__('The import associated with this export has been deleted.', 'wp_all_import_plugin')), 'updated' => urlencode(__('Please re-run your export by clicking Run Export on the All Export -> Manage Exports page. Then try your import again.', 'wp_all_import_plugin'))), remove_query_arg('id', $this->baseUrl))); die();
|
155 |
} else {
|
156 |
-
wp_redirect(add_query_arg('pmxi_nt', array('error' => urlencode(__('This import has been deleted.', 'wp_all_import_plugin'))), remove_query_arg('id', $this->baseUrl))); die();
|
157 |
}
|
158 |
} else {
|
159 |
$DefaultOptions['custom_type'] = $import->options['custom_type'];
|
@@ -438,11 +438,11 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
438 |
$this->errors->add('upload-validation', __('Please confirm you are importing a valid feed.<br/> Often, feed providers distribute feeds with invalid data, improperly wrapped HTML, line breaks where they should not be, faulty character encodings, syntax errors in the XML, and other issues.<br/><br/>WP All Import has checks in place to automatically fix some of the most common problems, but we can’t catch every single one.<br/><br/>It is also possible that there is a bug in WP All Import, and the problem is not with the feed.<br/><br/>If you need assistance, please contact support – <a href="mailto:support@wpallimport.com">support@wpallimport.com</a> – with your XML/CSV file. We will identify the problem and release a bug fix if necessary.', 'wp_all_import_plugin'));
|
439 |
$this->data['upload_validation'] = true;
|
440 |
} elseif( $redirect_to_template ) {
|
441 |
-
wp_redirect(add_query_arg('action', 'template', $this->baseUrl)); die();
|
442 |
} elseif( $post['auto_generate'] ) {
|
443 |
-
wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
|
444 |
} else {
|
445 |
-
wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
|
446 |
}
|
447 |
} else if ('url' == $this->input->post('type') and !empty($this->errors)) {
|
448 |
$this->errors->add('form-validation', __('WP All Import unable to detect file type.<br/><br/>WP All Import not able to determine what type of file you are importing. Make sure your file extension is correct for the file type you are importing.<br/> Please choose the correct file type from the dropdown below, or try adding &type=xml or &type=csv to the end of the URL, for example http://example.com/export-products.php?&type=xml', 'wp_all_import_plugin'));
|
@@ -487,7 +487,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
487 |
}
|
488 |
}
|
489 |
if ( ! $this->errors->get_error_codes()) {
|
490 |
-
wp_redirect(apply_filters('pmxi_element_redirect' , add_query_arg('action', 'template', $this->baseUrl))); die();
|
491 |
}
|
492 |
} else {
|
493 |
if ( PMXI_Plugin::$session->xpath ) {
|
@@ -525,7 +525,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
525 |
public function evaluate() {
|
526 |
|
527 |
if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
|
528 |
-
wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
|
529 |
}
|
530 |
|
531 |
// HTTP headers for no cache etc
|
@@ -674,7 +674,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
674 |
*/
|
675 |
public function evaluate_variations() {
|
676 |
if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
|
677 |
-
wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
|
678 |
}
|
679 |
|
680 |
$post = $this->input->post(array('xpath' => '', 'show_element' => 1, 'root_element' => (!empty(PMXI_Plugin::$session->source['root_element'])) ? PMXI_Plugin::$session->source['root_element'] : '', 'tagno' => 0, 'parent_tagno' => 1));
|
@@ -1612,7 +1612,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
1612 |
PMXI_Plugin::$session->save_data();
|
1613 |
}
|
1614 |
|
1615 |
-
wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
|
1616 |
|
1617 |
} else {
|
1618 |
$this->data['import']->set(array( 'options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->update();
|
@@ -1624,7 +1624,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
1624 |
if ($this->warnings->get_error_codes())
|
1625 |
$args['warnings'] = implode(',', $this->warnings->get_error_codes());
|
1626 |
|
1627 |
-
wp_redirect(add_query_arg( $args + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)) ,admin_url('admin.php')));
|
1628 |
die();
|
1629 |
}
|
1630 |
}
|
@@ -2124,7 +2124,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
2124 |
}
|
2125 |
|
2126 |
if ( ! $this->input->post('save_only')) {
|
2127 |
-
wp_redirect(add_query_arg('action', 'confirm', $this->baseUrl)); die();
|
2128 |
} else {
|
2129 |
$import = $this->data['update_previous'];
|
2130 |
$is_update = ! $import->isEmpty();
|
@@ -2138,7 +2138,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
2138 |
)
|
2139 |
)->save();
|
2140 |
|
2141 |
-
wp_redirect(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode($is_update ? __('Import updated', 'wp_all_import_plugin') : __('Import created', 'wp_all_import_plugin'))), admin_url('admin.php'))); die();
|
2142 |
}
|
2143 |
|
2144 |
} else {
|
@@ -2234,7 +2234,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
2234 |
|
2235 |
if ( ! $this->warnings->get_error_codes()) {
|
2236 |
$this->data['import']->set($source)->save();
|
2237 |
-
wp_redirect(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode(__('Configuration updated', 'wp_all_import_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php'))); die();
|
2238 |
} else {
|
2239 |
$source['root_element'] = $upload_result['root_element'];
|
2240 |
PMXI_Plugin::$session->set('source', $source);
|
@@ -2373,7 +2373,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
|
|
2373 |
}
|
2374 |
|
2375 |
if ( ! $this->errors->get_error_codes()) { // no validation errors found
|
2376 |
-
wp_redirect(add_query_arg('action', 'process', $this->baseUrl)); die();
|
2377 |
}
|
2378 |
|
2379 |
}
|
16 |
$id = $this->input->get('id');
|
17 |
$this->data['import'] = $import = new PMXI_Import_Record();
|
18 |
if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
|
19 |
+
wp_redirect(esc_url_raw(add_query_arg('page', 'pmxi-admin-manage', admin_url('admin.php')))); die();
|
20 |
}
|
21 |
$this->isWizard = false;
|
22 |
|
70 |
) {
|
71 |
if ( ! PMXI_Plugin::is_ajax() ){
|
72 |
$this->errors->add('form-validation', __('WP All Import lost track of where you are.<br/><br/>Maybe you cleared your cookies or maybe it is just a temporary issue on your or your web host\'s end.', 'wp_all_import_plugin'));
|
73 |
+
wp_redirect_or_javascript(esc_url_raw($this->baseUrl)); die();
|
74 |
}
|
75 |
}
|
76 |
|
87 |
|
88 |
if ( ! PMXI_Plugin::$session->get('xpath', false) or empty($elements) or ! $elements->length) {
|
89 |
$this->errors->add('form-validation', __('There are no elements to import based on your XPath.<br/><br/>If you are in Step 2, you probably specified filtering options that don’t match any elements present in your file.<br/>If you are seeing this error elsewhere, it means that while the XPath expression for your initial import matched some elements in your file previously, there are now zero elements in the file that match this expression.<br/>You can edit the XPath for your import by going to the Manage Imports -> Import Settings page.', 'wp_all_import_plugin'));
|
90 |
+
wp_redirect_or_javascript(esc_url_raw(add_query_arg('action', 'element', $this->baseUrl))); die();
|
91 |
}
|
92 |
|
93 |
if ('template' == $action or 'preview' == $action or 'tag' == $action) return true;
|
94 |
|
95 |
// step #4: options
|
96 |
if ( empty( PMXI_Plugin::$session->options ) ) {
|
97 |
+
wp_redirect_or_javascript(esc_url_raw(add_query_arg('action', 'template', $this->baseUrl))); die();
|
98 |
}
|
99 |
if ('options' == $action) return true;
|
100 |
|
101 |
if ( empty( PMXI_Plugin::$session->options ) ) {
|
102 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'options', $this->baseUrl))); die();
|
103 |
}
|
104 |
}
|
105 |
|
151 |
if ( $id ) { // update requested but corresponding import is not found
|
152 |
if ( $import->getById($id)->isEmpty() ) {
|
153 |
if ( ! empty($_GET['deligate']) and sanitize_key($_GET['deligate']) == 'wpallexport' ) {
|
154 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', array('error' => urlencode(__('The import associated with this export has been deleted.', 'wp_all_import_plugin')), 'updated' => urlencode(__('Please re-run your export by clicking Run Export on the All Export -> Manage Exports page. Then try your import again.', 'wp_all_import_plugin'))), remove_query_arg('id', $this->baseUrl)))); die();
|
155 |
} else {
|
156 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', array('error' => urlencode(__('This import has been deleted.', 'wp_all_import_plugin'))), remove_query_arg('id', $this->baseUrl)))); die();
|
157 |
}
|
158 |
} else {
|
159 |
$DefaultOptions['custom_type'] = $import->options['custom_type'];
|
438 |
$this->errors->add('upload-validation', __('Please confirm you are importing a valid feed.<br/> Often, feed providers distribute feeds with invalid data, improperly wrapped HTML, line breaks where they should not be, faulty character encodings, syntax errors in the XML, and other issues.<br/><br/>WP All Import has checks in place to automatically fix some of the most common problems, but we can’t catch every single one.<br/><br/>It is also possible that there is a bug in WP All Import, and the problem is not with the feed.<br/><br/>If you need assistance, please contact support – <a href="mailto:support@wpallimport.com">support@wpallimport.com</a> – with your XML/CSV file. We will identify the problem and release a bug fix if necessary.', 'wp_all_import_plugin'));
|
439 |
$this->data['upload_validation'] = true;
|
440 |
} elseif( $redirect_to_template ) {
|
441 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'template', $this->baseUrl))); die();
|
442 |
} elseif( $post['auto_generate'] ) {
|
443 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'options', $this->baseUrl))); die();
|
444 |
} else {
|
445 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'element', $this->baseUrl))); die();
|
446 |
}
|
447 |
} else if ('url' == $this->input->post('type') and !empty($this->errors)) {
|
448 |
$this->errors->add('form-validation', __('WP All Import unable to detect file type.<br/><br/>WP All Import not able to determine what type of file you are importing. Make sure your file extension is correct for the file type you are importing.<br/> Please choose the correct file type from the dropdown below, or try adding &type=xml or &type=csv to the end of the URL, for example http://example.com/export-products.php?&type=xml', 'wp_all_import_plugin'));
|
487 |
}
|
488 |
}
|
489 |
if ( ! $this->errors->get_error_codes()) {
|
490 |
+
wp_redirect(esc_url_raw(apply_filters('pmxi_element_redirect' , add_query_arg('action', 'template', $this->baseUrl)))); die();
|
491 |
}
|
492 |
} else {
|
493 |
if ( PMXI_Plugin::$session->xpath ) {
|
525 |
public function evaluate() {
|
526 |
|
527 |
if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
|
528 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'element', $this->baseUrl))); die();
|
529 |
}
|
530 |
|
531 |
// HTTP headers for no cache etc
|
674 |
*/
|
675 |
public function evaluate_variations() {
|
676 |
if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
|
677 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'element', $this->baseUrl))); die();
|
678 |
}
|
679 |
|
680 |
$post = $this->input->post(array('xpath' => '', 'show_element' => 1, 'root_element' => (!empty(PMXI_Plugin::$session->source['root_element'])) ? PMXI_Plugin::$session->source['root_element'] : '', 'tagno' => 0, 'parent_tagno' => 1));
|
1612 |
PMXI_Plugin::$session->save_data();
|
1613 |
}
|
1614 |
|
1615 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'options', $this->baseUrl))); die();
|
1616 |
|
1617 |
} else {
|
1618 |
$this->data['import']->set(array( 'options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->update();
|
1624 |
if ($this->warnings->get_error_codes())
|
1625 |
$args['warnings'] = implode(',', $this->warnings->get_error_codes());
|
1626 |
|
1627 |
+
wp_redirect(esc_url_raw(add_query_arg( $args + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)) ,admin_url('admin.php'))));
|
1628 |
die();
|
1629 |
}
|
1630 |
}
|
2124 |
}
|
2125 |
|
2126 |
if ( ! $this->input->post('save_only')) {
|
2127 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'confirm', $this->baseUrl))); die();
|
2128 |
} else {
|
2129 |
$import = $this->data['update_previous'];
|
2130 |
$is_update = ! $import->isEmpty();
|
2138 |
)
|
2139 |
)->save();
|
2140 |
|
2141 |
+
wp_redirect(esc_url_raw(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode($is_update ? __('Import updated', 'wp_all_import_plugin') : __('Import created', 'wp_all_import_plugin'))), admin_url('admin.php')))); die();
|
2142 |
}
|
2143 |
|
2144 |
} else {
|
2234 |
|
2235 |
if ( ! $this->warnings->get_error_codes()) {
|
2236 |
$this->data['import']->set($source)->save();
|
2237 |
+
wp_redirect(esc_url_raw(add_query_arg(array('page' => 'pmxi-admin-manage', 'pmxi_nt' => urlencode(__('Configuration updated', 'wp_all_import_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php')))); die();
|
2238 |
} else {
|
2239 |
$source['root_element'] = $upload_result['root_element'];
|
2240 |
PMXI_Plugin::$session->set('source', $source);
|
2373 |
}
|
2374 |
|
2375 |
if ( ! $this->errors->get_error_codes()) { // no validation errors found
|
2376 |
+
wp_redirect(esc_url_raw(add_query_arg('action', 'process', $this->baseUrl))); die();
|
2377 |
}
|
2378 |
|
2379 |
}
|
controllers/admin/manage.php
CHANGED
@@ -96,9 +96,9 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
96 |
}
|
97 |
}
|
98 |
if ( ! empty($import->options['custom_type']) && $import->options['custom_type'] == 'shop_order') {
|
99 |
-
wp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'edit'), $this->baseUrl)); die();
|
100 |
} else {
|
101 |
-
wp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'options'), $this->baseUrl)); die();
|
102 |
}
|
103 |
}
|
104 |
|
@@ -124,7 +124,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
124 |
'deleted' => 0
|
125 |
))->save();
|
126 |
}
|
127 |
-
wp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'update'), $this->baseUrl)); die();
|
128 |
}
|
129 |
}
|
130 |
|
@@ -297,7 +297,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
297 |
$this->data['cron_job_key'] = PMXI_Plugin::getInstance()->getOption('cron_job_key');
|
298 |
$this->data['item'] = $item = new PMXI_Import_Record();
|
299 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
300 |
-
wp_redirect($this->baseUrl); die();
|
301 |
}
|
302 |
|
303 |
$this->render();
|
@@ -319,7 +319,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
319 |
|
320 |
$item = new PMXI_Import_Record();
|
321 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
322 |
-
wp_redirect($this->baseUrl); die();
|
323 |
}
|
324 |
$item->set(array(
|
325 |
'triggered' => 0,
|
@@ -329,7 +329,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
329 |
'canceled_on' => date('Y-m-d H:i:s')
|
330 |
))->update();
|
331 |
|
332 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(__('Import canceled', 'wp_all_import_plugin')), $this->baseUrl)); die();
|
333 |
}
|
334 |
}
|
335 |
|
@@ -346,7 +346,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
346 |
|
347 |
$this->data['import'] = $item = new PMXI_Import_Record();
|
348 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
349 |
-
wp_redirect($this->baseUrl); die();
|
350 |
}
|
351 |
|
352 |
$this->data['isWizard'] = false;
|
@@ -546,7 +546,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
546 |
}
|
547 |
else
|
548 |
{
|
549 |
-
wp_redirect(add_query_arg(array('pmxi_nt' => urlencode(__('File does not exist.', 'wp_all_import_plugin'))), $this->baseUrl)); die();
|
550 |
}
|
551 |
}
|
552 |
}
|
@@ -558,7 +558,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
558 |
$id = $this->input->get('id');
|
559 |
$this->data['item'] = $item = new PMXI_Import_Record();
|
560 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
561 |
-
wp_redirect($this->baseUrl); die();
|
562 |
}
|
563 |
|
564 |
if ($this->input->post('is_confirmed')) {
|
@@ -570,7 +570,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
570 |
$is_delete_posts = $this->input->post('is_delete_posts', false);
|
571 |
|
572 |
if ( ! $is_delete_import and ! $is_delete_posts ){
|
573 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $this->baseUrl)); die();
|
574 |
}
|
575 |
|
576 |
do_action('pmxi_before_import_delete', $item, $is_delete_posts);
|
@@ -592,7 +592,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
592 |
$redirect_msg = __('Import and all associated posts deleted.', 'wp_all_import_plugin');
|
593 |
}
|
594 |
|
595 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode($redirect_msg), $this->baseUrl)); die();
|
596 |
}
|
597 |
|
598 |
$postList = new PMXI_Post_List();
|
@@ -614,7 +614,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
614 |
$this->data['ids'] = $ids = $this->input->post('items');
|
615 |
$this->data['items'] = $items = new PMXI_Import_List();
|
616 |
if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
|
617 |
-
wp_redirect($this->baseUrl); die();
|
618 |
}
|
619 |
|
620 |
if ($this->input->post('is_confirmed')) {
|
@@ -625,7 +625,7 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
|
|
625 |
$item->delete( ! $is_delete_posts, $is_deleted_images, $is_delete_attachments );
|
626 |
}
|
627 |
|
628 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(sprintf(__('%d %s deleted', 'wp_all_import_plugin'), $items->count(), _n('import', 'imports', $items->count(), 'wp_all_import_plugin'))), $this->baseUrl)); die();
|
629 |
}
|
630 |
|
631 |
$this->render();
|
96 |
}
|
97 |
}
|
98 |
if ( ! empty($import->options['custom_type']) && $import->options['custom_type'] == 'shop_order') {
|
99 |
+
wp_redirect(esc_url_raw(add_query_arg(array('id' => $import->id, 'action' => 'edit'), $this->baseUrl))); die();
|
100 |
} else {
|
101 |
+
wp_redirect(esc_url_raw(add_query_arg(array('id' => $import->id, 'action' => 'options'), $this->baseUrl))); die();
|
102 |
}
|
103 |
}
|
104 |
|
124 |
'deleted' => 0
|
125 |
))->save();
|
126 |
}
|
127 |
+
wp_redirect(esc_url_raw(add_query_arg(array('id' => $import->id, 'action' => 'update'), $this->baseUrl))); die();
|
128 |
}
|
129 |
}
|
130 |
|
297 |
$this->data['cron_job_key'] = PMXI_Plugin::getInstance()->getOption('cron_job_key');
|
298 |
$this->data['item'] = $item = new PMXI_Import_Record();
|
299 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
300 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
301 |
}
|
302 |
|
303 |
$this->render();
|
319 |
|
320 |
$item = new PMXI_Import_Record();
|
321 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
322 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
323 |
}
|
324 |
$item->set(array(
|
325 |
'triggered' => 0,
|
329 |
'canceled_on' => date('Y-m-d H:i:s')
|
330 |
))->update();
|
331 |
|
332 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('Import canceled', 'wp_all_import_plugin')), $this->baseUrl))); die();
|
333 |
}
|
334 |
}
|
335 |
|
346 |
|
347 |
$this->data['import'] = $item = new PMXI_Import_Record();
|
348 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
349 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
350 |
}
|
351 |
|
352 |
$this->data['isWizard'] = false;
|
546 |
}
|
547 |
else
|
548 |
{
|
549 |
+
wp_redirect(esc_url_raw(add_query_arg(array('pmxi_nt' => urlencode(__('File does not exist.', 'wp_all_import_plugin'))), $this->baseUrl))); die();
|
550 |
}
|
551 |
}
|
552 |
}
|
558 |
$id = $this->input->get('id');
|
559 |
$this->data['item'] = $item = new PMXI_Import_Record();
|
560 |
if ( ! $id or $item->getById($id)->isEmpty()) {
|
561 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
562 |
}
|
563 |
|
564 |
if ($this->input->post('is_confirmed')) {
|
570 |
$is_delete_posts = $this->input->post('is_delete_posts', false);
|
571 |
|
572 |
if ( ! $is_delete_import and ! $is_delete_posts ){
|
573 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $this->baseUrl))); die();
|
574 |
}
|
575 |
|
576 |
do_action('pmxi_before_import_delete', $item, $is_delete_posts);
|
592 |
$redirect_msg = __('Import and all associated posts deleted.', 'wp_all_import_plugin');
|
593 |
}
|
594 |
|
595 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode($redirect_msg), $this->baseUrl))); die();
|
596 |
}
|
597 |
|
598 |
$postList = new PMXI_Post_List();
|
614 |
$this->data['ids'] = $ids = $this->input->post('items');
|
615 |
$this->data['items'] = $items = new PMXI_Import_List();
|
616 |
if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
|
617 |
+
wp_redirect(esc_url_raw($this->baseUrl)); die();
|
618 |
}
|
619 |
|
620 |
if ($this->input->post('is_confirmed')) {
|
625 |
$item->delete( ! $is_delete_posts, $is_deleted_images, $is_delete_attachments );
|
626 |
}
|
627 |
|
628 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(sprintf(__('%d %s deleted', 'wp_all_import_plugin'), $items->count(), _n('import', 'imports', $items->count(), 'wp_all_import_plugin'))), $this->baseUrl))); die();
|
629 |
}
|
630 |
|
631 |
$this->render();
|
controllers/admin/settings.php
CHANGED
@@ -70,7 +70,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
70 |
|
71 |
$files = new PMXI_File_List(); $files->sweepHistory(); // adjust file history to new settings specified
|
72 |
|
73 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(__('Settings saved', 'wp_all_import_plugin')), $this->baseUrl)); die();
|
74 |
}
|
75 |
}
|
76 |
/*else{
|
@@ -129,7 +129,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
129 |
unset($template_data['id']);
|
130 |
$template->clear()->set($template_data)->insert();
|
131 |
}
|
132 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(sprintf(_n('%d template imported', '%d templates imported', count($templates_data), 'wp_all_import_plugin'), count($templates_data))), $this->baseUrl)); die();
|
133 |
}
|
134 |
}
|
135 |
}
|
@@ -155,7 +155,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
155 |
foreach ($templates_ids as $template_id) {
|
156 |
$template->clear()->set('id', $template_id)->delete();
|
157 |
}
|
158 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode(sprintf(_n('%d template deleted', '%d templates deleted', count($templates_ids), 'wp_all_import_plugin'), count($templates_ids))), $this->baseUrl)); die();
|
159 |
}
|
160 |
if ($this->input->post('export_templates')){
|
161 |
$export_data = array();
|
@@ -207,7 +207,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
207 |
);
|
208 |
|
209 |
// Call the custom API.
|
210 |
-
$response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) );
|
211 |
|
212 |
// make sure the response came back okay
|
213 |
if ( is_wp_error( $response ) )
|
@@ -253,7 +253,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
253 |
);
|
254 |
|
255 |
// Call the custom API.
|
256 |
-
$response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) );
|
257 |
|
258 |
if ( is_wp_error( $response ) )
|
259 |
return false;
|
@@ -364,7 +364,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
|
|
364 |
}
|
365 |
}
|
366 |
|
367 |
-
wp_redirect(add_query_arg('pmxi_nt', urlencode($msg), $this->baseUrl)); die();
|
368 |
}
|
369 |
|
370 |
public function dismiss(){
|
70 |
|
71 |
$files = new PMXI_File_List(); $files->sweepHistory(); // adjust file history to new settings specified
|
72 |
|
73 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(__('Settings saved', 'wp_all_import_plugin')), $this->baseUrl))); die();
|
74 |
}
|
75 |
}
|
76 |
/*else{
|
129 |
unset($template_data['id']);
|
130 |
$template->clear()->set($template_data)->insert();
|
131 |
}
|
132 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(sprintf(_n('%d template imported', '%d templates imported', count($templates_data), 'wp_all_import_plugin'), count($templates_data))), $this->baseUrl))); die();
|
133 |
}
|
134 |
}
|
135 |
}
|
155 |
foreach ($templates_ids as $template_id) {
|
156 |
$template->clear()->set('id', $template_id)->delete();
|
157 |
}
|
158 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode(sprintf(_n('%d template deleted', '%d templates deleted', count($templates_ids), 'wp_all_import_plugin'), count($templates_ids))), $this->baseUrl))); die();
|
159 |
}
|
160 |
if ($this->input->post('export_templates')){
|
161 |
$export_data = array();
|
207 |
);
|
208 |
|
209 |
// Call the custom API.
|
210 |
+
$response = wp_remote_get( esc_url_raw(add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) ));
|
211 |
|
212 |
// make sure the response came back okay
|
213 |
if ( is_wp_error( $response ) )
|
253 |
);
|
254 |
|
255 |
// Call the custom API.
|
256 |
+
$response = wp_remote_get( esc_url_raw(add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) ));
|
257 |
|
258 |
if ( is_wp_error( $response ) )
|
259 |
return false;
|
364 |
}
|
365 |
}
|
366 |
|
367 |
+
wp_redirect(esc_url_raw(add_query_arg('pmxi_nt', urlencode($msg), $this->baseUrl))); die();
|
368 |
}
|
369 |
|
370 |
public function dismiss(){
|
filters/wp_all_import_set_post_terms.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @param $assign_taxes
|
5 |
+
* @param $tx_name
|
6 |
+
* @param $pid
|
7 |
+
* @param $import_id
|
8 |
+
* @return array
|
9 |
+
*/
|
10 |
+
function pmxi_wp_all_import_set_post_terms($assign_taxes, $tx_name, $pid, $import_id){
|
11 |
+
if (empty($assign_taxes) && $tx_name == 'category'){
|
12 |
+
$term = is_exists_term('uncategorized', $tx_name, 0);
|
13 |
+
if ( !empty($term) and ! is_wp_error($term) ) {
|
14 |
+
$assign_taxes[] = $term['term_taxonomy_id'];
|
15 |
+
}
|
16 |
+
}
|
17 |
+
return $assign_taxes;
|
18 |
+
}
|
models/import/record.php
CHANGED
@@ -372,6 +372,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
372 |
|
373 |
// Delete posts from database.
|
374 |
if (!empty($missing_ids) && is_array($missing_ids)) {
|
|
|
375 |
$missing_ids_arr = array_chunk($missing_ids, $this->options['records_per_request']);
|
376 |
$count_deleted_missing_records = 0;
|
377 |
foreach ($missing_ids_arr as $key => $missingPostRecords) {
|
@@ -416,6 +417,19 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
416 |
$to_delete = false;
|
417 |
}
|
418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
$to_delete = apply_filters('wp_all_import_is_post_to_delete', $to_delete, $missingPostRecord['post_id'], $this);
|
420 |
|
421 |
// Delete posts that are no longer present in your file
|
@@ -526,61 +540,6 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
526 |
}
|
527 |
}
|
528 |
|
529 |
-
// Set out of stock status for missing records [Woocommerce add-on option]
|
530 |
-
if ((empty($this->options['is_delete_missing']) || $this->options['is_update_missing_cf'] || $this->options['set_missing_to_draft']) and $this->options['custom_type'] == "product" and class_exists('PMWI_Plugin') and !empty($this->options['missing_records_stock_status']) and "manual" != $this->options['duplicate_matching']) {
|
531 |
-
|
532 |
-
$postList = new PMXI_Post_List();
|
533 |
-
$args = array('import_id' => $this->id, 'iteration !=' => $this->iteration);
|
534 |
-
if ( ! empty($this->options['is_import_specified']) ) $args['specified'] = 1;
|
535 |
-
$missing_ids = array();
|
536 |
-
$missingPosts = $postList->getBy($args);
|
537 |
-
|
538 |
-
if (!$missingPosts->isEmpty()) {
|
539 |
-
foreach ($missingPosts as $missingPost) {
|
540 |
-
$missing_ids[] = $missingPost;
|
541 |
-
}
|
542 |
-
}
|
543 |
-
// Delete posts from database.
|
544 |
-
if (!empty($missing_ids) && is_array($missing_ids)) {
|
545 |
-
$missing_ids_arr = array_chunk($missing_ids, 50);
|
546 |
-
foreach ($missing_ids_arr as $key => $missingPostRecords) {
|
547 |
-
if (!empty($missingPostRecords)) {
|
548 |
-
foreach ( $missingPostRecords as $k => $missingPostRecord ) {
|
549 |
-
$this->update_meta( $missingPostRecord['post_id'], '_stock_status', 'outofstock' );
|
550 |
-
$this->update_meta( $missingPostRecord['post_id'], '_stock', 0 );
|
551 |
-
$term_ids = wp_get_object_terms($missingPostRecord['post_id'], 'product_visibility', array('fields' => 'ids'));
|
552 |
-
$outofstock_term = get_term_by( 'name', 'outofstock', 'product_visibility' );
|
553 |
-
if (!empty($outofstock_term) && !is_wp_error($outofstock_term) && !in_array($outofstock_term->term_taxonomy_id, $term_ids)){
|
554 |
-
$term_ids[] = $outofstock_term->term_taxonomy_id;
|
555 |
-
}
|
556 |
-
$this->associate_terms( $missingPostRecord['post_id'], $term_ids, 'product_visibility', $logger );
|
557 |
-
|
558 |
-
$postRecord = new PMXI_Post_Record();
|
559 |
-
$postRecord->getBy(array(
|
560 |
-
'post_id' => $missingPostRecord['post_id'],
|
561 |
-
'import_id' => $this->id,
|
562 |
-
));
|
563 |
-
if (!$postRecord->isEmpty() && empty($this->options['is_delete_missing'])) {
|
564 |
-
$postRecord->set(array(
|
565 |
-
'iteration' => $this->iteration
|
566 |
-
))->save();
|
567 |
-
}
|
568 |
-
unset($postRecord);
|
569 |
-
}
|
570 |
-
|
571 |
-
$this->set(array(
|
572 |
-
'processing' => 0
|
573 |
-
))->update();
|
574 |
-
|
575 |
-
return array(
|
576 |
-
'status' => 200,
|
577 |
-
'message' => sprintf(__('Updating stock status for missing records %s for import #%s', 'wp_all_import_plugin'), count($missing_ids), $this->id)
|
578 |
-
);
|
579 |
-
}
|
580 |
-
}
|
581 |
-
}
|
582 |
-
}
|
583 |
-
|
584 |
$this->set(array(
|
585 |
'processing' => 0,
|
586 |
'triggered' => 0,
|
@@ -2567,7 +2526,10 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
2567 |
}
|
2568 |
}
|
2569 |
// Update post content
|
2570 |
-
|
|
|
|
|
|
|
2571 |
}
|
2572 |
}
|
2573 |
|
@@ -3521,7 +3483,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
3521 |
$is_import_complete = ($records_count == $records_to_import);
|
3522 |
|
3523 |
// Set out of stock status for missing records [Woocommerce add-on option]
|
3524 |
-
|
3525 |
|
3526 |
$logger and call_user_func($logger, __('Update stock status previously imported posts which are no longer actual...', 'wp_all_import_plugin'));
|
3527 |
$args = array('import_id' => $this->id, 'iteration !=' => $this->iteration);
|
@@ -3775,6 +3737,19 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
3775 |
$to_delete = false;
|
3776 |
}
|
3777 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3778 |
$to_delete = apply_filters('wp_all_import_is_post_to_delete', $to_delete, $missingPostRecord['post_id'], $this);
|
3779 |
|
3780 |
if ($to_delete) {
|
@@ -3946,20 +3921,24 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
3946 |
return wp_set_object_terms($pid, $term_ids, $tx_name);
|
3947 |
}
|
3948 |
|
3949 |
-
|
3950 |
|
3951 |
-
|
3952 |
|
3953 |
-
|
3954 |
-
|
3955 |
-
|
3956 |
-
|
3957 |
-
|
|
|
|
|
|
|
|
|
3958 |
|
3959 |
-
|
3960 |
|
3961 |
-
|
3962 |
-
|
3963 |
|
3964 |
$term_ids = array();
|
3965 |
foreach ( $assign_taxes as $tt ) {
|
@@ -3979,7 +3958,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
|
|
3979 |
}
|
3980 |
}
|
3981 |
|
3982 |
-
|
3983 |
}
|
3984 |
|
3985 |
/**
|
372 |
|
373 |
// Delete posts from database.
|
374 |
if (!empty($missing_ids) && is_array($missing_ids)) {
|
375 |
+
$outofstock_term = get_term_by( 'name', 'outofstock', 'product_visibility' );
|
376 |
$missing_ids_arr = array_chunk($missing_ids, $this->options['records_per_request']);
|
377 |
$count_deleted_missing_records = 0;
|
378 |
foreach ($missing_ids_arr as $key => $missingPostRecords) {
|
417 |
$to_delete = false;
|
418 |
}
|
419 |
|
420 |
+
if (!empty($this->options['missing_records_stock_status']) && class_exists('PMWI_Plugin') && $this->options['custom_type'] == "product") {
|
421 |
+
update_post_meta( $missingPostRecord['post_id'], '_stock_status', 'outofstock' );
|
422 |
+
update_post_meta( $missingPostRecord['post_id'], '_stock', 0 );
|
423 |
+
|
424 |
+
$term_ids = wp_get_object_terms($missingPostRecord['post_id'], 'product_visibility', array('fields' => 'ids'));
|
425 |
+
|
426 |
+
if (!empty($outofstock_term) && !is_wp_error($outofstock_term) && !in_array($outofstock_term->term_taxonomy_id, $term_ids)){
|
427 |
+
$term_ids[] = $outofstock_term->term_taxonomy_id;
|
428 |
+
}
|
429 |
+
$this->associate_terms( $missingPostRecord['post_id'], $term_ids, 'product_visibility', $logger );
|
430 |
+
$to_delete = false;
|
431 |
+
}
|
432 |
+
|
433 |
$to_delete = apply_filters('wp_all_import_is_post_to_delete', $to_delete, $missingPostRecord['post_id'], $this);
|
434 |
|
435 |
// Delete posts that are no longer present in your file
|
540 |
}
|
541 |
}
|
542 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
$this->set(array(
|
544 |
'processing' => 0,
|
545 |
'triggered' => 0,
|
2526 |
}
|
2527 |
}
|
2528 |
// Update post content
|
2529 |
+
wp_update_post( [
|
2530 |
+
'ID' => $pid,
|
2531 |
+
'post_content' => $articleData['post_content']
|
2532 |
+
] );
|
2533 |
}
|
2534 |
}
|
2535 |
|
3483 |
$is_import_complete = ($records_count == $records_to_import);
|
3484 |
|
3485 |
// Set out of stock status for missing records [Woocommerce add-on option]
|
3486 |
+
if ( $is_import_complete && !empty($this->options['is_delete_missing']) && $this->options['custom_type'] == "product" && class_exists('PMWI_Plugin') && !empty($this->options['missing_records_stock_status']) && "manual" != $this->options['duplicate_matching']) {
|
3487 |
|
3488 |
$logger and call_user_func($logger, __('Update stock status previously imported posts which are no longer actual...', 'wp_all_import_plugin'));
|
3489 |
$args = array('import_id' => $this->id, 'iteration !=' => $this->iteration);
|
3737 |
$to_delete = false;
|
3738 |
}
|
3739 |
|
3740 |
+
if (!empty($this->options['missing_records_stock_status']) && class_exists('PMWI_Plugin') && $this->options['custom_type'] == "product") {
|
3741 |
+
update_post_meta( $missingPostRecord['post_id'], '_stock_status', 'outofstock' );
|
3742 |
+
update_post_meta( $missingPostRecord['post_id'], '_stock', 0 );
|
3743 |
+
|
3744 |
+
$term_ids = wp_get_object_terms($missingPostRecord['post_id'], 'product_visibility', array('fields' => 'ids'));
|
3745 |
+
|
3746 |
+
if (!empty($outofstock_term) && !is_wp_error($outofstock_term) && !in_array($outofstock_term->term_taxonomy_id, $term_ids)){
|
3747 |
+
$term_ids[] = $outofstock_term->term_taxonomy_id;
|
3748 |
+
}
|
3749 |
+
$this->associate_terms( $missingPostRecord['post_id'], $term_ids, 'product_visibility', $logger );
|
3750 |
+
$to_delete = false;
|
3751 |
+
}
|
3752 |
+
|
3753 |
$to_delete = apply_filters('wp_all_import_is_post_to_delete', $to_delete, $missingPostRecord['post_id'], $this);
|
3754 |
|
3755 |
if ($to_delete) {
|
3921 |
return wp_set_object_terms($pid, $term_ids, $tx_name);
|
3922 |
}
|
3923 |
|
3924 |
+
$term_ids = wp_get_object_terms( $pid, $tx_name, array( 'fields' => 'ids' ) );
|
3925 |
|
3926 |
+
$assign_taxes = ( is_array( $assign_taxes ) ) ? array_filter( $assign_taxes ) : false;
|
3927 |
|
3928 |
+
if ( ! empty( $term_ids ) && ! is_wp_error( $term_ids ) ) {
|
3929 |
+
$tids = [];
|
3930 |
+
foreach ($term_ids as $t) {
|
3931 |
+
$tids[] = is_object($t) ? $t->term_taxonomy_id : $t;
|
3932 |
+
}
|
3933 |
+
$in_tt_ids = "'" . implode( "', '", $tids ) . "'";
|
3934 |
+
$this->wpdb->query( "UPDATE {$this->wpdb->term_taxonomy} SET count = count - 1 WHERE term_taxonomy_id IN ($in_tt_ids) AND count > 0" );
|
3935 |
+
$this->wpdb->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->term_relationships} WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $pid ) );
|
3936 |
+
}
|
3937 |
|
3938 |
+
if ( empty( $assign_taxes ) ) return;
|
3939 |
|
3940 |
+
$values = array();
|
3941 |
+
$term_order = 0;
|
3942 |
|
3943 |
$term_ids = array();
|
3944 |
foreach ( $assign_taxes as $tt ) {
|
3958 |
}
|
3959 |
}
|
3960 |
|
3961 |
+
wp_cache_delete( $pid, $tx_name . '_relationships' );
|
3962 |
}
|
3963 |
|
3964 |
/**
|
plugin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP All Import
|
4 |
Plugin URI: http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
|
5 |
Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
|
6 |
-
Version: 3.6.
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
|
@@ -25,7 +25,7 @@ define('WP_ALL_IMPORT_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
|
|
25 |
*/
|
26 |
define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
|
27 |
|
28 |
-
define('PMXI_VERSION', '3.6.
|
29 |
|
30 |
define('PMXI_EDITION', 'free');
|
31 |
|
@@ -1172,7 +1172,7 @@ final class PMXI_Plugin {
|
|
1172 |
'search_existing_images' => 1,
|
1173 |
|
1174 |
'create_new_records' => 1,
|
1175 |
-
'is_selective_hashing' =>
|
1176 |
'is_delete_missing' => 0,
|
1177 |
'set_missing_to_draft' => 0,
|
1178 |
'is_update_missing_cf' => 0,
|
3 |
Plugin Name: WP All Import
|
4 |
Plugin URI: http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
|
5 |
Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
|
6 |
+
Version: 3.6.7
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
|
25 |
*/
|
26 |
define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
|
27 |
|
28 |
+
define('PMXI_VERSION', '3.6.7');
|
29 |
|
30 |
define('PMXI_EDITION', 'free');
|
31 |
|
1172 |
'search_existing_images' => 1,
|
1173 |
|
1174 |
'create_new_records' => 1,
|
1175 |
+
'is_selective_hashing' => 0,
|
1176 |
'is_delete_missing' => 0,
|
1177 |
'set_missing_to_draft' => 0,
|
1178 |
'is_update_missing_cf' => 0,
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Import any XML or CSV File to WordPress ===
|
2 |
Contributors: soflyy, wpallimport
|
3 |
Requires at least: 4.1
|
4 |
-
Tested up to:
|
5 |
-
Stable tag: 3.6.
|
6 |
Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
|
7 |
|
8 |
WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
|
@@ -105,6 +105,18 @@ Does it work with special character encoding like Hebrew, Arabic, Chinese, etc?
|
|
105 |
|
106 |
== Changelog ==
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
= 3.6.6 =
|
109 |
* bug fix: jQuery nestedSortable compatibility with WordPress 5.9
|
110 |
|
1 |
=== Import any XML or CSV File to WordPress ===
|
2 |
Contributors: soflyy, wpallimport
|
3 |
Requires at least: 4.1
|
4 |
+
Tested up to: 6.0
|
5 |
+
Stable tag: 3.6.7
|
6 |
Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
|
7 |
|
8 |
WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
+
= 3.6.7 =
|
109 |
+
* security improvement
|
110 |
+
* improvement: changed Manage Imports page button labels to be more precise
|
111 |
+
* improvement: assign 'Uncategorized' term to posts imported without a category assigned
|
112 |
+
* improvement: add support for taxonomies that return objects instead of IDs
|
113 |
+
* improvement: remove commented code that could cause false positives for security scans
|
114 |
+
* bug fix: jQuery error related to 'destroy' method
|
115 |
+
* bug fix: rare issue that prevented content image URLs from being updated during import
|
116 |
+
* bug fix: taxonomies section drag and drop doesn't save after rearranging fields
|
117 |
+
* bug fix: conflict with Advanced Ads plugin
|
118 |
+
* bug fix: 'Instead of deletion, set missing records to out of stock' still deleting products
|
119 |
+
|
120 |
= 3.6.6 =
|
121 |
* bug fix: jQuery nestedSortable compatibility with WordPress 5.9
|
122 |
|
static/js/admin.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
*/
|
4 |
(function($){$(function () {
|
5 |
|
6 |
-
if ( ! $('body.wpallimport-plugin').length) return; // do not execute any code if we are not on plugin page
|
7 |
-
|
8 |
function wpai_set_custom_select_image() {
|
9 |
// The class name to add to the element.
|
10 |
var class_name = jQuery('[class^="dd-selected-text dashicon"]').text().toLowerCase();
|
@@ -65,9 +65,9 @@
|
|
65 |
|
66 |
// fix wpallimport-layout position
|
67 |
setTimeout(function () {
|
68 |
-
$('table.wpallimport-layout').length && $('table.wpallimport-layout td.left h2:first-child').css('margin-top', $('.wrap').offset().top - $('table.wpallimport-layout').offset().top);
|
69 |
}, 10);
|
70 |
-
|
71 |
// help icons
|
72 |
$(document).tipsy({
|
73 |
gravity: function() {
|
@@ -201,8 +201,8 @@
|
|
201 |
});
|
202 |
});
|
203 |
|
204 |
-
var toggle_dynamic_notice = function(){
|
205 |
-
|
206 |
$('.wpallimport-dynamic-notice').hide();
|
207 |
|
208 |
var $import_to_custom_type = $('input[name=custom_type]').val();
|
@@ -210,7 +210,7 @@
|
|
210 |
var $is_show_cf_notice = false;
|
211 |
var $is_show_images_notice = false;
|
212 |
|
213 |
-
$('input[name^=custom_name]').each(function(){
|
214 |
if ( $(this).val() != "")
|
215 |
{
|
216 |
$is_show_cf_notice = true;
|
@@ -218,7 +218,7 @@
|
|
218 |
}
|
219 |
});
|
220 |
|
221 |
-
if ( $import_to_custom_type != 'product' &&
|
222 |
( $('textarea[name=download_featured_image]').length && $('textarea[name=download_featured_image]').val() != "" ||
|
223 |
$('textarea[name=gallery_featured_image]').length && $('textarea[name=gallery_featured_image]').val() != "" ||
|
224 |
$('textarea[name=featured_image]').length && $('textarea[name=featured_image]').val() != "" ))
|
@@ -234,19 +234,19 @@
|
|
234 |
$('.wpallimport-dynamic-notice').find('a').html($('.wpallimport-dynamic-notice-cf-text').val());
|
235 |
$('.wpallimport-dynamic-notice').show();
|
236 |
}
|
237 |
-
else if ( $is_show_images_notice ) {
|
238 |
$('.wpallimport-dynamic-notice').find('a').html($('.wpallimport-dynamic-notice-images-text').val());
|
239 |
$('.wpallimport-dynamic-notice').show();
|
240 |
}
|
241 |
-
|
242 |
}
|
243 |
|
244 |
$('.change_file').each(function(){
|
245 |
|
246 |
-
|
|
|
|
|
247 |
|
248 |
-
var formHeight = $wrap.height();
|
249 |
-
|
250 |
var fixWrapHeight = false;
|
251 |
|
252 |
$('#custom_type_selector').ddslick({
|
@@ -376,7 +376,7 @@
|
|
376 |
// enter-submit form on step 1
|
377 |
$('.wpallimport-step-1').each(function(){
|
378 |
|
379 |
-
var $wrap = $('.wrap');
|
380 |
|
381 |
var formHeight = ($('.wpallimport-layout').height() < 730) ? 730 : $('.wpallimport-layout').height();
|
382 |
|
@@ -444,7 +444,7 @@
|
|
444 |
$('.wpai-ftp-select-file-button').click(function () {
|
445 |
$(this).parents('.wpallimport-download-resource').find('.wpallimport-free-edition-notice').slideDown();
|
446 |
});
|
447 |
-
|
448 |
var fixWrapHeight = false;
|
449 |
|
450 |
$('#custom_type_selector').ddslick({
|
@@ -476,8 +476,8 @@
|
|
476 |
}
|
477 |
|
478 |
if (is_import_denied)
|
479 |
-
{
|
480 |
-
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
|
481 |
$('.wpallimport-import-orders-notice').show();
|
482 |
}
|
483 |
else
|
@@ -485,21 +485,21 @@
|
|
485 |
$('.wpallimport-import-orders-notice').hide();
|
486 |
|
487 |
if ($('.wpallimport-upload-resource-step-two:visible').length)
|
488 |
-
{
|
489 |
-
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').show();
|
490 |
}
|
491 |
else
|
492 |
-
{
|
493 |
-
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
|
494 |
}
|
495 |
}
|
496 |
|
497 |
// Rapid Add-On API Images
|
498 |
wpai_set_custom_select_image();
|
499 |
-
}
|
500 |
-
});
|
501 |
|
502 |
-
$('.wpallimport-import-to').click(function(){
|
503 |
if ($(this).attr('rel') == 'new'){
|
504 |
$('.wpallimport-new-records').show();
|
505 |
$('.wpallimport-existing-records').hide();
|
@@ -1581,7 +1581,7 @@
|
|
1581 |
});
|
1582 |
|
1583 |
$(document).on('click', '.add-new-ico', function() {
|
1584 |
-
let count = $(this).parents('tr:first').find('ol.sortable').find('li.dragging').
|
1585 |
let $template = $(this).parents('td:first').find('ol').children('li.template');
|
1586 |
$clone = $template.clone(true);
|
1587 |
$clone.addClass('dragging').attr({'id': $clone.attr('id') + '_' + count}).find('input[type=checkbox][name^=categories_mapping]').each(function(){
|
@@ -1610,15 +1610,15 @@
|
|
1610 |
$('ol.sortable').each(function(){
|
1611 |
if ( ! $(this).children('li').not('.template').length ) $(this).next('.add-new-ico').click();
|
1612 |
});
|
1613 |
-
|
1614 |
$('form.wpallimport-template').find('input[type=submit]').on('click', function(e){
|
1615 |
|
1616 |
e.preventDefault();
|
1617 |
-
|
1618 |
$('.hierarhy-output').each(function(){
|
1619 |
var sortable = $(this).parents('td:first').find('.ui-sortable:first');
|
1620 |
if (sortable.length){
|
1621 |
-
$(this).val(window.JSON.stringify(sortable.pmxi_nestedSortable('toArray', {startDepthCount: 0})));
|
1622 |
if ($(this).parents('td:first').find('input:first').val() == '') $(this).val('');
|
1623 |
}
|
1624 |
});
|
@@ -1632,7 +1632,7 @@
|
|
1632 |
|
1633 |
$('.custom_type[rel=serialized]').each(function(){
|
1634 |
var values = new Array();
|
1635 |
-
$(this).find('.form-field').each(function(){
|
1636 |
var skey = $(this).find('.serialized_key').val();
|
1637 |
if ('' == skey){
|
1638 |
values.push($(this).find('.serialized_value').val());
|
@@ -1640,7 +1640,7 @@
|
|
1640 |
var obj = {};
|
1641 |
obj[skey] = $(this).find('.serialized_value').val();
|
1642 |
values.push(obj);
|
1643 |
-
}
|
1644 |
});
|
1645 |
$(this).find('input[name^=serialized_values]').val(window.JSON.stringify(values));
|
1646 |
});
|
@@ -1650,7 +1650,7 @@
|
|
1650 |
$(this).find('.form-field').each(function(){
|
1651 |
if ($(this).find('.mapping_to').val() != "") {
|
1652 |
var skey = $(this).find('.mapping_from').val();
|
1653 |
-
if ('' != skey){
|
1654 |
var obj = {};
|
1655 |
obj[skey] = $(this).find('.mapping_to').val();
|
1656 |
values.push(obj);
|
@@ -1664,7 +1664,7 @@
|
|
1664 |
|
1665 |
$(this).parents('form:first').submit();
|
1666 |
|
1667 |
-
});
|
1668 |
|
1669 |
$('.wpallimport-step-4').each(function(){
|
1670 |
$(this).find('input[name^=custom_duplicate_name]').autocomplete({
|
@@ -1680,7 +1680,7 @@
|
|
1680 |
var $template = $(this).parents('table').first().children('tbody').children('tr.template');
|
1681 |
$number = $(this).parents('table').first().children('tbody').children('tr').length - 2;
|
1682 |
$clone = $template.clone(true);
|
1683 |
-
|
1684 |
$clone.find('div[rel^=serialized]').attr({'id':'serialized_' + $number}).find('table:first').attr({'rel':'serialized_' + $number});
|
1685 |
$clone.find('div[rel^=mapping]').attr({'id':'cf_mapping_' + $number}).find('table:first').attr({'rel':'cf_mapping_' + $number});
|
1686 |
$clone.find('a.specify_cf').attr({'rel':'serialized_' + $number})
|
@@ -1703,7 +1703,7 @@
|
|
1703 |
$template.clone(true).insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
|
1704 |
});
|
1705 |
|
1706 |
-
/* END Categories hierarchy */
|
1707 |
|
1708 |
$('form.options').each(function(){
|
1709 |
var $form = $(this);
|
@@ -1715,7 +1715,7 @@
|
|
1715 |
});
|
1716 |
|
1717 |
$('form.edit').each(function(){
|
1718 |
-
var $form = $(this);
|
1719 |
$form.find('.wpallimport-change-unique-key').on('click', function(){
|
1720 |
var $ths = $(this);
|
1721 |
$( "#dialog-confirm" ).dialog({
|
@@ -1725,7 +1725,7 @@
|
|
1725 |
modal: true,
|
1726 |
draggable: false,
|
1727 |
buttons: {
|
1728 |
-
"Continue": function() {
|
1729 |
$( this ).dialog( "close" );
|
1730 |
$ths.hide();
|
1731 |
$('input[name=unique_key]').removeAttr('disabled').focus();
|
@@ -1742,11 +1742,11 @@
|
|
1742 |
$uniqueKey.val($tmpUniqueKey.val());
|
1743 |
});
|
1744 |
});
|
1745 |
-
|
1746 |
// chunk files upload
|
1747 |
if ($('#plupload-ui').length) {
|
1748 |
$('#plupload-ui').show();
|
1749 |
-
$('#html-upload-ui').hide();
|
1750 |
|
1751 |
wplupload = $('#select-files').wplupload({
|
1752 |
runtimes : 'gears,browserplus,html5,flash,silverlight,html4',
|
@@ -1756,11 +1756,11 @@
|
|
1756 |
file_data_name : 'async-upload',
|
1757 |
multipart: true,
|
1758 |
max_file_size: '1000mb',
|
1759 |
-
chunk_size: '1mb',
|
1760 |
drop_element: 'plupload-ui',
|
1761 |
multipart_params : {}
|
1762 |
});
|
1763 |
-
}
|
1764 |
|
1765 |
/* END plupload scripts */
|
1766 |
|
@@ -1769,7 +1769,7 @@
|
|
1769 |
$('#logwrapper').slideToggle(100, function(){
|
1770 |
$('#import_finished').css({'visibility':'visible'});
|
1771 |
});
|
1772 |
-
});
|
1773 |
|
1774 |
// Select Encoding
|
1775 |
$('#import_encoding').on('change', function(){
|
@@ -1781,9 +1781,9 @@
|
|
1781 |
|
1782 |
$('#cancel_new_encoding').on('click', function(){
|
1783 |
$('#add_encoding').hide();
|
1784 |
-
$('#select_encoding').show();
|
1785 |
$('#new_encoding').val('');
|
1786 |
-
$('#import_encoding').prop('selectedIndex', 0);
|
1787 |
});
|
1788 |
|
1789 |
$('#add_new_encoding').on('click', function(){
|
@@ -1791,33 +1791,33 @@
|
|
1791 |
if ("" != new_encoding){
|
1792 |
$('#import_encoding').prepend('<option value="'+new_encoding+'">' + new_encoding + '</option>');
|
1793 |
$('#cancel_new_encoding').click();
|
1794 |
-
$('#import_encoding').prop('selectedIndex',0);
|
1795 |
}
|
1796 |
else alert('Please enter encoding.');
|
1797 |
});
|
1798 |
|
1799 |
$('input[name=keep_custom_fields]').on('click', function(){
|
1800 |
$(this).parents('.input:first').find('.keep_except').slideToggle();
|
1801 |
-
});
|
1802 |
-
|
1803 |
-
$('.pmxi_choosen').each(function(){
|
1804 |
$(this).find(".choosen_input").select2({
|
1805 |
tags: $(this).find('.choosen_values').html().split(','),
|
1806 |
-
width: '80%',
|
1807 |
});
|
1808 |
-
});
|
1809 |
|
1810 |
if (typeof wpPointerL10n != "undefined") wpPointerL10n.dismiss = 'Close';
|
1811 |
|
1812 |
$('.show_hints').on('click', function(){
|
1813 |
-
var $ths = $(this);
|
1814 |
$('.wpallimport-overlay').show();
|
1815 |
|
1816 |
$(this).pointer({
|
1817 |
content: $('#' + $ths.attr('rel')).html(),
|
1818 |
position: {
|
1819 |
edge: 'right',
|
1820 |
-
align: 'center'
|
1821 |
},
|
1822 |
pointerWidth: 715,
|
1823 |
close: function() {
|
@@ -1828,11 +1828,11 @@
|
|
1828 |
$('.wpallimport-overlay').hide();
|
1829 |
}
|
1830 |
}).pointer('open');
|
1831 |
-
});
|
1832 |
|
1833 |
// Serialized Custom Field Dialog
|
1834 |
$('.pmxi_cf_pointer').on('click', function(){
|
1835 |
-
var $ths = $(this);
|
1836 |
//$('.wpallimport-overlay').show();
|
1837 |
|
1838 |
if ($ths.parents('.form-field:first').find('input[name^=custom_name]').val() == "") {
|
@@ -1845,7 +1845,7 @@
|
|
1845 |
content: $('#' + $ths.attr('rel')).html(),
|
1846 |
position: {
|
1847 |
edge: 'top',
|
1848 |
-
align: 'center'
|
1849 |
},
|
1850 |
pointerWidth: 450,
|
1851 |
close: function() {
|
@@ -1856,7 +1856,7 @@
|
|
1856 |
//$('.wpallimport-overlay').hide();
|
1857 |
}
|
1858 |
}).pointer('open');
|
1859 |
-
});
|
1860 |
|
1861 |
// Custom Fields Mapping Dialog
|
1862 |
$('.wpallimport-cf-menu li').on('click', function(){
|
@@ -1864,12 +1864,12 @@
|
|
1864 |
if ($triggerEvent.hasClass('pmxi_cf_mapping')){
|
1865 |
|
1866 |
//$('.wpallimport-overlay').show();
|
1867 |
-
var $ths = $triggerEvent;
|
1868 |
$triggerEvent.pointer({
|
1869 |
content: $('#' + $ths.attr('rel')).html(),
|
1870 |
position: {
|
1871 |
edge: 'right',
|
1872 |
-
align: 'center'
|
1873 |
},
|
1874 |
pointerWidth: 450,
|
1875 |
close: function() {
|
@@ -1879,15 +1879,15 @@
|
|
1879 |
});
|
1880 |
//$('.wpallimport-overlay').hide();
|
1881 |
}
|
1882 |
-
}).pointer('open');
|
1883 |
}
|
1884 |
-
});
|
1885 |
|
1886 |
$('.wpallimport-overlay').on('click', function(){
|
1887 |
$('.wp-pointer').hide();
|
1888 |
$('fieldset.wp-all-import-scheduling-help').hide();
|
1889 |
$(this).hide();
|
1890 |
-
});
|
1891 |
|
1892 |
if ($('#wp_all_import_code').length){
|
1893 |
var editor = wp.codeEditor.initialize($('#wp_all_import_code'), wpai_cm_settings);
|
@@ -1896,8 +1896,8 @@
|
|
1896 |
resize: function() {
|
1897 |
editor.setSize("100%", $(this).height());
|
1898 |
}
|
1899 |
-
});
|
1900 |
-
}
|
1901 |
|
1902 |
$('.wp_all_import_ajax_deletion').click(function(e){
|
1903 |
e.preventDefault();
|
@@ -1949,7 +1949,7 @@
|
|
1949 |
if ($('#wp_all_import_code').length) editor.codemirror.setCursor(1);
|
1950 |
});
|
1951 |
} else {
|
1952 |
-
$parent.addClass('closed');
|
1953 |
$parent.find('.wpallimport-collapsed-content:first').slideUp();
|
1954 |
}
|
1955 |
});
|
@@ -1973,12 +1973,12 @@
|
|
1973 |
|
1974 |
$('.wpallimport-wpae-notify-read-more').on('click', function(e){
|
1975 |
e.preventDefault();
|
1976 |
-
|
1977 |
var request = {
|
1978 |
-
action: 'dismiss_notifications',
|
1979 |
-
security: wp_all_import_security,
|
1980 |
addon: $(this).parent('div:first').attr('rel')
|
1981 |
-
};
|
1982 |
|
1983 |
var ths = $(this);
|
1984 |
|
@@ -1987,11 +1987,11 @@
|
|
1987 |
url: ajaxurl,
|
1988 |
data: request,
|
1989 |
success: function(response) {
|
1990 |
-
|
1991 |
-
},
|
1992 |
dataType: "json"
|
1993 |
});
|
1994 |
-
|
1995 |
$(this).parent('div:first').slideUp();
|
1996 |
|
1997 |
window.open($(this).attr('href'), '_blank');
|
@@ -2007,7 +2007,7 @@
|
|
2007 |
$('.wp-all-import-sure-to-delete').show();
|
2008 |
}
|
2009 |
if ( ! $('#is_delete_import').is(':checked') && ! $('#is_delete_posts').is(':checked')) {
|
2010 |
-
$('.wp-all-import-sure-to-delete').hide();
|
2011 |
$('.delete-single-import').attr('disabled', 'disabled');
|
2012 |
}
|
2013 |
if ( $('#is_delete_import').is(':checked') && $('#is_delete_posts').is(':checked')) {
|
@@ -2031,19 +2031,19 @@
|
|
2031 |
|
2032 |
$('#is_delete_import, #is_delete_posts').on('click', function(){
|
2033 |
wpai_are_sure_to_delete_import();
|
2034 |
-
});
|
2035 |
// [\ Delete Import]
|
2036 |
|
2037 |
if ($('.switcher-target-update_choosen_data').length) {
|
2038 |
var $re_import_options = $('.switcher-target-update_choosen_data');
|
2039 |
var $toggle_re_import_options = $('.wpallimport-trigger-options');
|
2040 |
-
|
2041 |
if ($re_import_options.find('input[type=checkbox]').length == $re_import_options.find('input[type=checkbox]:checked').length) {
|
2042 |
-
var $newtitle = $toggle_re_import_options.attr('rel');
|
2043 |
$toggle_re_import_options.attr('rel', $toggle_re_import_options.html());
|
2044 |
$toggle_re_import_options.html($newtitle);
|
2045 |
$toggle_re_import_options.removeClass('wpallimport-select-all');
|
2046 |
-
}
|
2047 |
}
|
2048 |
|
2049 |
$('.wpallimport-trigger-options').on('click', function(){
|
@@ -2051,7 +2051,7 @@
|
|
2051 |
var $newtitle = $(this).attr('rel');
|
2052 |
if ( $(this).hasClass('wpallimport-select-all') ) {
|
2053 |
$parent.find('input[type=checkbox]').not('.exclude-select-all').removeAttr('checked').click();
|
2054 |
-
$(this).removeClass('wpallimport-select-all');
|
2055 |
} else {
|
2056 |
$parent.find('input[type=checkbox]:checked').not('.exclude-select-all').click();
|
2057 |
$(this).addClass('wpallimport-select-all');
|
@@ -2092,21 +2092,21 @@
|
|
2092 |
}
|
2093 |
}
|
2094 |
|
2095 |
-
fix_tag_position();
|
2096 |
|
2097 |
-
$(document).scroll(function() {
|
2098 |
-
fix_tag_position();
|
2099 |
toggle_dynamic_notice();
|
2100 |
-
});
|
2101 |
-
|
2102 |
toggle_dynamic_notice();
|
2103 |
|
2104 |
$('input[name^=custom_name], input[name^=custom_value], textarea[name=download_featured_image], textarea[name=gallery_featured_image], textarea[name=featured_image]').change(function() {
|
2105 |
-
toggle_dynamic_notice();
|
2106 |
});
|
2107 |
|
2108 |
$('input[name^=custom_name], input[name^=custom_value], textarea[name=download_featured_image], textarea[name=gallery_featured_image], textarea[name=featured_image]').blur(function() {
|
2109 |
-
toggle_dynamic_notice();
|
2110 |
});
|
2111 |
|
2112 |
|
3 |
*/
|
4 |
(function($){$(function () {
|
5 |
|
6 |
+
if ( ! $('body.wpallimport-plugin').length) return; // do not execute any code if we are not on plugin page
|
7 |
+
|
8 |
function wpai_set_custom_select_image() {
|
9 |
// The class name to add to the element.
|
10 |
var class_name = jQuery('[class^="dd-selected-text dashicon"]').text().toLowerCase();
|
65 |
|
66 |
// fix wpallimport-layout position
|
67 |
setTimeout(function () {
|
68 |
+
$('table.wpallimport-layout').length && $('table.wpallimport-layout td.left h2:first-child').css('margin-top', $('.wrap').has('.wpallimport-layout').offset().top - $('table.wpallimport-layout').offset().top);
|
69 |
}, 10);
|
70 |
+
|
71 |
// help icons
|
72 |
$(document).tipsy({
|
73 |
gravity: function() {
|
201 |
});
|
202 |
});
|
203 |
|
204 |
+
var toggle_dynamic_notice = function(){
|
205 |
+
|
206 |
$('.wpallimport-dynamic-notice').hide();
|
207 |
|
208 |
var $import_to_custom_type = $('input[name=custom_type]').val();
|
210 |
var $is_show_cf_notice = false;
|
211 |
var $is_show_images_notice = false;
|
212 |
|
213 |
+
$('input[name^=custom_name]').each(function(){
|
214 |
if ( $(this).val() != "")
|
215 |
{
|
216 |
$is_show_cf_notice = true;
|
218 |
}
|
219 |
});
|
220 |
|
221 |
+
if ( $import_to_custom_type != 'product' &&
|
222 |
( $('textarea[name=download_featured_image]').length && $('textarea[name=download_featured_image]').val() != "" ||
|
223 |
$('textarea[name=gallery_featured_image]').length && $('textarea[name=gallery_featured_image]').val() != "" ||
|
224 |
$('textarea[name=featured_image]').length && $('textarea[name=featured_image]').val() != "" ))
|
234 |
$('.wpallimport-dynamic-notice').find('a').html($('.wpallimport-dynamic-notice-cf-text').val());
|
235 |
$('.wpallimport-dynamic-notice').show();
|
236 |
}
|
237 |
+
else if ( $is_show_images_notice ) {
|
238 |
$('.wpallimport-dynamic-notice').find('a').html($('.wpallimport-dynamic-notice-images-text').val());
|
239 |
$('.wpallimport-dynamic-notice').show();
|
240 |
}
|
241 |
+
|
242 |
}
|
243 |
|
244 |
$('.change_file').each(function(){
|
245 |
|
246 |
+
let $wrap = $('.wrap').has('.wpallimport-layout');
|
247 |
+
|
248 |
+
var formHeight = $wrap.height();
|
249 |
|
|
|
|
|
250 |
var fixWrapHeight = false;
|
251 |
|
252 |
$('#custom_type_selector').ddslick({
|
376 |
// enter-submit form on step 1
|
377 |
$('.wpallimport-step-1').each(function(){
|
378 |
|
379 |
+
var $wrap = $('.wrap').has('.wpallimport-layout');
|
380 |
|
381 |
var formHeight = ($('.wpallimport-layout').height() < 730) ? 730 : $('.wpallimport-layout').height();
|
382 |
|
444 |
$('.wpai-ftp-select-file-button').click(function () {
|
445 |
$(this).parents('.wpallimport-download-resource').find('.wpallimport-free-edition-notice').slideDown();
|
446 |
});
|
447 |
+
|
448 |
var fixWrapHeight = false;
|
449 |
|
450 |
$('#custom_type_selector').ddslick({
|
476 |
}
|
477 |
|
478 |
if (is_import_denied)
|
479 |
+
{
|
480 |
+
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
|
481 |
$('.wpallimport-import-orders-notice').show();
|
482 |
}
|
483 |
else
|
485 |
$('.wpallimport-import-orders-notice').hide();
|
486 |
|
487 |
if ($('.wpallimport-upload-resource-step-two:visible').length)
|
488 |
+
{
|
489 |
+
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').show();
|
490 |
}
|
491 |
else
|
492 |
+
{
|
493 |
+
$('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
|
494 |
}
|
495 |
}
|
496 |
|
497 |
// Rapid Add-On API Images
|
498 |
wpai_set_custom_select_image();
|
499 |
+
}
|
500 |
+
});
|
501 |
|
502 |
+
$('.wpallimport-import-to').click(function(){
|
503 |
if ($(this).attr('rel') == 'new'){
|
504 |
$('.wpallimport-new-records').show();
|
505 |
$('.wpallimport-existing-records').hide();
|
1581 |
});
|
1582 |
|
1583 |
$(document).on('click', '.add-new-ico', function() {
|
1584 |
+
let count = parseInt($(this).parents('tr:first').find('ol.sortable').find('li.dragging').last().attr('id').replace('item_', '')) + 1;
|
1585 |
let $template = $(this).parents('td:first').find('ol').children('li.template');
|
1586 |
$clone = $template.clone(true);
|
1587 |
$clone.addClass('dragging').attr({'id': $clone.attr('id') + '_' + count}).find('input[type=checkbox][name^=categories_mapping]').each(function(){
|
1610 |
$('ol.sortable').each(function(){
|
1611 |
if ( ! $(this).children('li').not('.template').length ) $(this).next('.add-new-ico').click();
|
1612 |
});
|
1613 |
+
|
1614 |
$('form.wpallimport-template').find('input[type=submit]').on('click', function(e){
|
1615 |
|
1616 |
e.preventDefault();
|
1617 |
+
|
1618 |
$('.hierarhy-output').each(function(){
|
1619 |
var sortable = $(this).parents('td:first').find('.ui-sortable:first');
|
1620 |
if (sortable.length){
|
1621 |
+
$(this).val(window.JSON.stringify(sortable.pmxi_nestedSortable('toArray', {startDepthCount: 0})));
|
1622 |
if ($(this).parents('td:first').find('input:first').val() == '') $(this).val('');
|
1623 |
}
|
1624 |
});
|
1632 |
|
1633 |
$('.custom_type[rel=serialized]').each(function(){
|
1634 |
var values = new Array();
|
1635 |
+
$(this).find('.form-field').each(function(){
|
1636 |
var skey = $(this).find('.serialized_key').val();
|
1637 |
if ('' == skey){
|
1638 |
values.push($(this).find('.serialized_value').val());
|
1640 |
var obj = {};
|
1641 |
obj[skey] = $(this).find('.serialized_value').val();
|
1642 |
values.push(obj);
|
1643 |
+
}
|
1644 |
});
|
1645 |
$(this).find('input[name^=serialized_values]').val(window.JSON.stringify(values));
|
1646 |
});
|
1650 |
$(this).find('.form-field').each(function(){
|
1651 |
if ($(this).find('.mapping_to').val() != "") {
|
1652 |
var skey = $(this).find('.mapping_from').val();
|
1653 |
+
if ('' != skey){
|
1654 |
var obj = {};
|
1655 |
obj[skey] = $(this).find('.mapping_to').val();
|
1656 |
values.push(obj);
|
1664 |
|
1665 |
$(this).parents('form:first').submit();
|
1666 |
|
1667 |
+
});
|
1668 |
|
1669 |
$('.wpallimport-step-4').each(function(){
|
1670 |
$(this).find('input[name^=custom_duplicate_name]').autocomplete({
|
1680 |
var $template = $(this).parents('table').first().children('tbody').children('tr.template');
|
1681 |
$number = $(this).parents('table').first().children('tbody').children('tr').length - 2;
|
1682 |
$clone = $template.clone(true);
|
1683 |
+
|
1684 |
$clone.find('div[rel^=serialized]').attr({'id':'serialized_' + $number}).find('table:first').attr({'rel':'serialized_' + $number});
|
1685 |
$clone.find('div[rel^=mapping]').attr({'id':'cf_mapping_' + $number}).find('table:first').attr({'rel':'cf_mapping_' + $number});
|
1686 |
$clone.find('a.specify_cf').attr({'rel':'serialized_' + $number})
|
1703 |
$template.clone(true).insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
|
1704 |
});
|
1705 |
|
1706 |
+
/* END Categories hierarchy */
|
1707 |
|
1708 |
$('form.options').each(function(){
|
1709 |
var $form = $(this);
|
1715 |
});
|
1716 |
|
1717 |
$('form.edit').each(function(){
|
1718 |
+
var $form = $(this);
|
1719 |
$form.find('.wpallimport-change-unique-key').on('click', function(){
|
1720 |
var $ths = $(this);
|
1721 |
$( "#dialog-confirm" ).dialog({
|
1725 |
modal: true,
|
1726 |
draggable: false,
|
1727 |
buttons: {
|
1728 |
+
"Continue": function() {
|
1729 |
$( this ).dialog( "close" );
|
1730 |
$ths.hide();
|
1731 |
$('input[name=unique_key]').removeAttr('disabled').focus();
|
1742 |
$uniqueKey.val($tmpUniqueKey.val());
|
1743 |
});
|
1744 |
});
|
1745 |
+
|
1746 |
// chunk files upload
|
1747 |
if ($('#plupload-ui').length) {
|
1748 |
$('#plupload-ui').show();
|
1749 |
+
$('#html-upload-ui').hide();
|
1750 |
|
1751 |
wplupload = $('#select-files').wplupload({
|
1752 |
runtimes : 'gears,browserplus,html5,flash,silverlight,html4',
|
1756 |
file_data_name : 'async-upload',
|
1757 |
multipart: true,
|
1758 |
max_file_size: '1000mb',
|
1759 |
+
chunk_size: '1mb',
|
1760 |
drop_element: 'plupload-ui',
|
1761 |
multipart_params : {}
|
1762 |
});
|
1763 |
+
}
|
1764 |
|
1765 |
/* END plupload scripts */
|
1766 |
|
1769 |
$('#logwrapper').slideToggle(100, function(){
|
1770 |
$('#import_finished').css({'visibility':'visible'});
|
1771 |
});
|
1772 |
+
});
|
1773 |
|
1774 |
// Select Encoding
|
1775 |
$('#import_encoding').on('change', function(){
|
1781 |
|
1782 |
$('#cancel_new_encoding').on('click', function(){
|
1783 |
$('#add_encoding').hide();
|
1784 |
+
$('#select_encoding').show();
|
1785 |
$('#new_encoding').val('');
|
1786 |
+
$('#import_encoding').prop('selectedIndex', 0);
|
1787 |
});
|
1788 |
|
1789 |
$('#add_new_encoding').on('click', function(){
|
1791 |
if ("" != new_encoding){
|
1792 |
$('#import_encoding').prepend('<option value="'+new_encoding+'">' + new_encoding + '</option>');
|
1793 |
$('#cancel_new_encoding').click();
|
1794 |
+
$('#import_encoding').prop('selectedIndex',0);
|
1795 |
}
|
1796 |
else alert('Please enter encoding.');
|
1797 |
});
|
1798 |
|
1799 |
$('input[name=keep_custom_fields]').on('click', function(){
|
1800 |
$(this).parents('.input:first').find('.keep_except').slideToggle();
|
1801 |
+
});
|
1802 |
+
|
1803 |
+
$('.pmxi_choosen').each(function(){
|
1804 |
$(this).find(".choosen_input").select2({
|
1805 |
tags: $(this).find('.choosen_values').html().split(','),
|
1806 |
+
width: '80%',
|
1807 |
});
|
1808 |
+
});
|
1809 |
|
1810 |
if (typeof wpPointerL10n != "undefined") wpPointerL10n.dismiss = 'Close';
|
1811 |
|
1812 |
$('.show_hints').on('click', function(){
|
1813 |
+
var $ths = $(this);
|
1814 |
$('.wpallimport-overlay').show();
|
1815 |
|
1816 |
$(this).pointer({
|
1817 |
content: $('#' + $ths.attr('rel')).html(),
|
1818 |
position: {
|
1819 |
edge: 'right',
|
1820 |
+
align: 'center'
|
1821 |
},
|
1822 |
pointerWidth: 715,
|
1823 |
close: function() {
|
1828 |
$('.wpallimport-overlay').hide();
|
1829 |
}
|
1830 |
}).pointer('open');
|
1831 |
+
});
|
1832 |
|
1833 |
// Serialized Custom Field Dialog
|
1834 |
$('.pmxi_cf_pointer').on('click', function(){
|
1835 |
+
var $ths = $(this);
|
1836 |
//$('.wpallimport-overlay').show();
|
1837 |
|
1838 |
if ($ths.parents('.form-field:first').find('input[name^=custom_name]').val() == "") {
|
1845 |
content: $('#' + $ths.attr('rel')).html(),
|
1846 |
position: {
|
1847 |
edge: 'top',
|
1848 |
+
align: 'center'
|
1849 |
},
|
1850 |
pointerWidth: 450,
|
1851 |
close: function() {
|
1856 |
//$('.wpallimport-overlay').hide();
|
1857 |
}
|
1858 |
}).pointer('open');
|
1859 |
+
});
|
1860 |
|
1861 |
// Custom Fields Mapping Dialog
|
1862 |
$('.wpallimport-cf-menu li').on('click', function(){
|
1864 |
if ($triggerEvent.hasClass('pmxi_cf_mapping')){
|
1865 |
|
1866 |
//$('.wpallimport-overlay').show();
|
1867 |
+
var $ths = $triggerEvent;
|
1868 |
$triggerEvent.pointer({
|
1869 |
content: $('#' + $ths.attr('rel')).html(),
|
1870 |
position: {
|
1871 |
edge: 'right',
|
1872 |
+
align: 'center'
|
1873 |
},
|
1874 |
pointerWidth: 450,
|
1875 |
close: function() {
|
1879 |
});
|
1880 |
//$('.wpallimport-overlay').hide();
|
1881 |
}
|
1882 |
+
}).pointer('open');
|
1883 |
}
|
1884 |
+
});
|
1885 |
|
1886 |
$('.wpallimport-overlay').on('click', function(){
|
1887 |
$('.wp-pointer').hide();
|
1888 |
$('fieldset.wp-all-import-scheduling-help').hide();
|
1889 |
$(this).hide();
|
1890 |
+
});
|
1891 |
|
1892 |
if ($('#wp_all_import_code').length){
|
1893 |
var editor = wp.codeEditor.initialize($('#wp_all_import_code'), wpai_cm_settings);
|
1896 |
resize: function() {
|
1897 |
editor.setSize("100%", $(this).height());
|
1898 |
}
|
1899 |
+
});
|
1900 |
+
}
|
1901 |
|
1902 |
$('.wp_all_import_ajax_deletion').click(function(e){
|
1903 |
e.preventDefault();
|
1949 |
if ($('#wp_all_import_code').length) editor.codemirror.setCursor(1);
|
1950 |
});
|
1951 |
} else {
|
1952 |
+
$parent.addClass('closed');
|
1953 |
$parent.find('.wpallimport-collapsed-content:first').slideUp();
|
1954 |
}
|
1955 |
});
|
1973 |
|
1974 |
$('.wpallimport-wpae-notify-read-more').on('click', function(e){
|
1975 |
e.preventDefault();
|
1976 |
+
|
1977 |
var request = {
|
1978 |
+
action: 'dismiss_notifications',
|
1979 |
+
security: wp_all_import_security,
|
1980 |
addon: $(this).parent('div:first').attr('rel')
|
1981 |
+
};
|
1982 |
|
1983 |
var ths = $(this);
|
1984 |
|
1987 |
url: ajaxurl,
|
1988 |
data: request,
|
1989 |
success: function(response) {
|
1990 |
+
|
1991 |
+
},
|
1992 |
dataType: "json"
|
1993 |
});
|
1994 |
+
|
1995 |
$(this).parent('div:first').slideUp();
|
1996 |
|
1997 |
window.open($(this).attr('href'), '_blank');
|
2007 |
$('.wp-all-import-sure-to-delete').show();
|
2008 |
}
|
2009 |
if ( ! $('#is_delete_import').is(':checked') && ! $('#is_delete_posts').is(':checked')) {
|
2010 |
+
$('.wp-all-import-sure-to-delete').hide();
|
2011 |
$('.delete-single-import').attr('disabled', 'disabled');
|
2012 |
}
|
2013 |
if ( $('#is_delete_import').is(':checked') && $('#is_delete_posts').is(':checked')) {
|
2031 |
|
2032 |
$('#is_delete_import, #is_delete_posts').on('click', function(){
|
2033 |
wpai_are_sure_to_delete_import();
|
2034 |
+
});
|
2035 |
// [\ Delete Import]
|
2036 |
|
2037 |
if ($('.switcher-target-update_choosen_data').length) {
|
2038 |
var $re_import_options = $('.switcher-target-update_choosen_data');
|
2039 |
var $toggle_re_import_options = $('.wpallimport-trigger-options');
|
2040 |
+
|
2041 |
if ($re_import_options.find('input[type=checkbox]').length == $re_import_options.find('input[type=checkbox]:checked').length) {
|
2042 |
+
var $newtitle = $toggle_re_import_options.attr('rel');
|
2043 |
$toggle_re_import_options.attr('rel', $toggle_re_import_options.html());
|
2044 |
$toggle_re_import_options.html($newtitle);
|
2045 |
$toggle_re_import_options.removeClass('wpallimport-select-all');
|
2046 |
+
}
|
2047 |
}
|
2048 |
|
2049 |
$('.wpallimport-trigger-options').on('click', function(){
|
2051 |
var $newtitle = $(this).attr('rel');
|
2052 |
if ( $(this).hasClass('wpallimport-select-all') ) {
|
2053 |
$parent.find('input[type=checkbox]').not('.exclude-select-all').removeAttr('checked').click();
|
2054 |
+
$(this).removeClass('wpallimport-select-all');
|
2055 |
} else {
|
2056 |
$parent.find('input[type=checkbox]:checked').not('.exclude-select-all').click();
|
2057 |
$(this).addClass('wpallimport-select-all');
|
2092 |
}
|
2093 |
}
|
2094 |
|
2095 |
+
fix_tag_position();
|
2096 |
|
2097 |
+
$(document).scroll(function() {
|
2098 |
+
fix_tag_position();
|
2099 |
toggle_dynamic_notice();
|
2100 |
+
});
|
2101 |
+
|
2102 |
toggle_dynamic_notice();
|
2103 |
|
2104 |
$('input[name^=custom_name], input[name^=custom_value], textarea[name=download_featured_image], textarea[name=gallery_featured_image], textarea[name=featured_image]').change(function() {
|
2105 |
+
toggle_dynamic_notice();
|
2106 |
});
|
2107 |
|
2108 |
$('input[name^=custom_name], input[name^=custom_value], textarea[name=download_featured_image], textarea[name=gallery_featured_image], textarea[name=featured_image]').blur(function() {
|
2109 |
+
toggle_dynamic_notice();
|
2110 |
});
|
2111 |
|
2112 |
|
static/js/jquery/jquery.ui-contextmenu.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
/*! jQuery UI context menu plugin - v1.5.0 - 2014-07-06 | https://github.com/mar10/jquery-ui-contextmenu | Copyright (c) 2014 Martin Wendt; Licensed MIT */
|
2 |
-
!function(a,b,c,d){"use strict";var e,f,g="onselectstart"in c.createElement("div");a.widget("moogle.contextmenu",{version:"1.4.0-1",options:{autoTrigger:!0,delegate:null,hide:{effect:"fadeOut",duration:"fast"},ignoreParentSelect:!0,menu:null,position:null,preventContextMenuForPopup:!1,preventSelect:!1,show:{effect:"slideDown",duration:"fast"},taphold:!1,beforeOpen:a.noop,blur:a.noop,close:a.noop,create:a.noop,createMenu:a.noop,focus:a.noop,open:a.noop,select:a.noop},_create:function(){var b,d,e,f=this.options;if(this.$headStyle=null,this.$menu=null,this.menuIsTemp=!1,this.currentTarget=null,f.preventSelect){e=(a(this.element).is(c)?a("body"):this.element).uniqueId().attr("id"),b="#"+e+" "+f.delegate+" { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }",this.$headStyle=a("<style class='moogle-contextmenu-style' />").prop("type","text/css").appendTo("head");try{this.$headStyle.html(b)}catch(h){this.$headStyle[0].styleSheet.cssText=b}g&&this.element.delegate(f.delegate,"selectstart"+this.eventNamespace,function(a){a.preventDefault()})}this._createUiMenu(f.menu),d="contextmenu"+this.eventNamespace,f.taphold&&(d+=" taphold"+this.eventNamespace),this.element.delegate(f.delegate,d,a.proxy(this._openMenu,this))},_destroy:function(){this.element.undelegate(this.eventNamespace),this._createUiMenu(null),this.$headStyle&&(this.$headStyle.remove(),this.$headStyle=null)},_createUiMenu:function(b){var c;this.isOpen()&&(c=this.currentTarget,this._closeMenu(!0),this.currentTarget=c),this.menuIsTemp?this.$menu.remove():this.$menu&&this.$menu.
|
1 |
/*! jQuery UI context menu plugin - v1.5.0 - 2014-07-06 | https://github.com/mar10/jquery-ui-contextmenu | Copyright (c) 2014 Martin Wendt; Licensed MIT */
|
2 |
+
!function(a,b,c,d){"use strict";var e,f,g="onselectstart"in c.createElement("div");a.widget("moogle.contextmenu",{version:"1.4.0-1",options:{autoTrigger:!0,delegate:null,hide:{effect:"fadeOut",duration:"fast"},ignoreParentSelect:!0,menu:null,position:null,preventContextMenuForPopup:!1,preventSelect:!1,show:{effect:"slideDown",duration:"fast"},taphold:!1,beforeOpen:a.noop,blur:a.noop,close:a.noop,create:a.noop,createMenu:a.noop,focus:a.noop,open:a.noop,select:a.noop},_create:function(){var b,d,e,f=this.options;if(this.$headStyle=null,this.$menu=null,this.menuIsTemp=!1,this.currentTarget=null,f.preventSelect){e=(a(this.element).is(c)?a("body"):this.element).uniqueId().attr("id"),b="#"+e+" "+f.delegate+" { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }",this.$headStyle=a("<style class='moogle-contextmenu-style' />").prop("type","text/css").appendTo("head");try{this.$headStyle.html(b)}catch(h){this.$headStyle[0].styleSheet.cssText=b}g&&this.element.delegate(f.delegate,"selectstart"+this.eventNamespace,function(a){a.preventDefault()})}this._createUiMenu(f.menu),d="contextmenu"+this.eventNamespace,f.taphold&&(d+=" taphold"+this.eventNamespace),this.element.delegate(f.delegate,d,a.proxy(this._openMenu,this))},_destroy:function(){this.element.undelegate(this.eventNamespace),this._createUiMenu(null),this.$headStyle&&(this.$headStyle.remove(),this.$headStyle=null)},_createUiMenu:function(b){var c;this.isOpen()&&(c=this.currentTarget,this._closeMenu(!0),this.currentTarget=c),this.menuIsTemp?this.$menu.remove():this.$menu&&this.$menu.hide(),this.$menu=null,this.menuIsTemp=!1,b&&(a.isArray(b)?(this.$menu=a.moogle.contextmenu.createMenuMarkup(b),this.menuIsTemp=!0):this.$menu="string"==typeof b?a(b):b,this.$menu.hide().menu({blur:a.proxy(this.options.blur,this),create:a.proxy(this.options.createMenu,this),focus:a.proxy(this.options.focus,this),select:a.proxy(function(b,c){var d,e=a.moogle.contextmenu.isMenu(c.item),f=c.item.data("actionHandler");c.cmd=c.item.attr("data-command"),c.target=a(this.currentTarget),e&&this.options.ignoreParentSelect||(d=this._trigger.call(this,"select",b,c),f&&(d=f.call(this,b,c)),d!==!1&&this._closeMenu.call(this),b.preventDefault())},this)}))},_openMenu:function(b){var e=this.options,f=e.position,g=this,h=!!b.isTrigger,i={menu:this.$menu,target:a(b.target),extraData:b.extraData,originalEvent:b};if(e.autoTrigger||h){if(this.currentTarget=b.target,b.preventDefault(),this._trigger("beforeOpen",b,i)===!1)return this.currentTarget=null,!1;i.menu=this.$menu,a(c).bind("keydown"+this.eventNamespace,function(b){b.which===a.ui.keyCode.ESCAPE&&g._closeMenu()}).bind("mousedown"+this.eventNamespace+" touchstart"+this.eventNamespace,function(b){a(b.target).closest(".ui-menu-item").length||g._closeMenu()}),a.isFunction(f)&&(f=f(b,i)),f=a.extend({my:"left top",at:"left bottom",of:b.pageX===d?b.target:b,collision:"fit"},f),this.$menu.show().css({position:"absolute",left:0,top:0}).position(f).hide(),e.preventContextMenuForPopup&&this.$menu.bind("contextmenu"+this.eventNamespace,function(a){a.preventDefault()}),this._show(this.$menu,this.options.show,function(){g._trigger.call(g,"open",b,i)})}},_closeMenu:function(b){var d=this,e=b?!1:this.options.hide;a(c).unbind("mousedown"+this.eventNamespace).unbind("touchstart"+this.eventNamespace).unbind("keydown"+this.eventNamespace),this.$menu.unbind("contextmenu"+this.eventNamespace),d.currentTarget=null,this._hide(this.$menu,e,function(){d._trigger("close")})},_setOption:function(b,c){switch(b){case"menu":this.replaceMenu(c)}a.Widget.prototype._setOption.apply(this,arguments)},_getMenuEntry:function(a){return this.$menu.find("li[data-command="+a+"]")},close:function(){this.isOpen()&&this._closeMenu()},enableEntry:function(a,b){this._getMenuEntry(a).toggleClass("ui-state-disabled",b===!1)},getMenu:function(){return this.$menu},isOpen:function(){return!!this.$menu&&!!this.currentTarget},open:function(a,b){b=b||{};var c=jQuery.Event("contextmenu",{target:a.get(0),extraData:b});return this.element.trigger(c)},replaceMenu:function(a){this._createUiMenu(a)},setEntry:function(b,c){var d=this._getMenuEntry(b);"string"==typeof c?a.moogle.contextmenu.updateTitle(d,c):(d.empty(),c.cmd=c.cmd||b,a.moogle.contextmenu.createEntryMarkup(c,d))},showEntry:function(a,b){this._getMenuEntry(a).toggle(b!==!1)}}),a.extend(a.moogle.contextmenu,{createMenuMarkup:function(b,c){var d,e,f,g;for(null==c&&(c=a("<ul class='ui-helper-hidden' />").appendTo("body")),d=0;d<b.length;d++)e=b[d],g=a("<li/>").appendTo(c),a.moogle.contextmenu.createEntryMarkup(e,g),a.isArray(e.children)&&(f=a("<ul/>").appendTo(g),a.moogle.contextmenu.createMenuMarkup(e.children,f));return c},replaceFirstTextNodeChild:function(a,b){a.contents().filter(function(){return 3===this.nodeType}).first().replaceWith(b)}}),e=a.ui.menu.version.match(/^(\d)\.(\d+)/),f={major:parseInt(e[1],10),minor:parseInt(e[2],10)},f.major<2&&f.minor<11?a.extend(a.moogle.contextmenu,{createEntryMarkup:function(b,c){var d=null;/[^\-\u2014\u2013\s]/.test(b.title)?(c.attr("data-command",b.cmd),d=a("<a/>",{html:""+b.title,href:"#"}).appendTo(c),a.isFunction(b.action)&&c.data("actionHandler",b.action),b.uiIcon&&d.append(a("<span class='ui-icon' />").addClass(b.uiIcon)),b.disabled&&c.addClass("ui-state-disabled"),a.isPlainObject(b.data)&&d.data(b.data)):c.text(b.title)},isMenu:function(a){return a.has(">a[aria-haspopup='true']").length>0},updateTitle:function(b,c){a.moogle.contextmenu.replaceFirstTextNodeChild(a("a",b),c)}}):a.extend(a.moogle.contextmenu,{createEntryMarkup:function(b,c){/[^\-\u2014\u2013\s]/.test(b.title)?(c.attr("data-command",b.cmd).html(""+b.title),a.isFunction(b.action)&&c.data("actionHandler",b.action),b.uiIcon&&c.append(a("<span class='ui-icon' />").addClass(b.uiIcon)),b.disabled&&c.addClass("ui-state-disabled"),a.isPlainObject(b.data)&&c.data(b.data)):c.text(b.title)},isMenu:function(a){return a.is("[aria-haspopup='true']")},updateTitle:function(b,c){a.moogle.contextmenu.replaceFirstTextNodeChild(b,c)}})}(jQuery,window,document);
|
views/admin/import/options/_reimport_options.php
CHANGED
@@ -29,41 +29,42 @@
|
|
29 |
<label for="is_delete_missing" <?php if ( "new" != $post['wizard_type']): ?>style="color:#ccc;"<?php endif; ?>><?php printf(__('Delete %s that are no longer present in your file', 'wp_all_import_plugin'), esc_attr($cpt_name)) ?></label>
|
30 |
<?php if ( "new" != $post['wizard_type']): ?>
|
31 |
<a href="#help" class="wpallimport-help" title="<?php _e('Records removed from the import file can only be deleted when importing into New Items. This feature cannot be enabled when importing into Existing Items.', 'wp_all_import_plugin') ?>" style="position:relative; top: -1px;">?</a>
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
<div class="switcher-target-is_delete_missing" style="padding-left:17px;">
|
35 |
<div class="input">
|
36 |
<input type="hidden" name="is_keep_attachments" value="0" />
|
37 |
<input type="checkbox" id="is_keep_attachments" name="is_keep_attachments" value="1" <?php echo $post['is_keep_attachments'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
38 |
-
<label for="is_keep_attachments"><?php _e('Do not remove attachments', 'wp_all_import_plugin') ?></label>
|
39 |
</div>
|
40 |
<div class="input">
|
41 |
<input type="hidden" name="is_keep_imgs" value="0" />
|
42 |
<input type="checkbox" id="is_keep_imgs" name="is_keep_imgs" value="1" <?php echo $post['is_keep_imgs'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
43 |
-
<label for="is_keep_imgs"><?php _e('Do not remove images', 'wp_all_import_plugin') ?></label>
|
44 |
</div>
|
45 |
<div class="input">
|
46 |
<input type="hidden" name="is_update_missing_cf" value="0" />
|
47 |
<input type="checkbox" id="is_update_missing_cf" name="is_update_missing_cf" value="1" <?php echo $post['is_update_missing_cf'] ? 'checked="checked"': '' ?> class="switcher" <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
48 |
-
<label for="is_update_missing_cf"><?php _e('Instead of deletion, set Custom Field', 'wp_all_import_plugin') ?></label>
|
49 |
<div class="switcher-target-is_update_missing_cf" style="padding-left:17px;">
|
50 |
<div class="input">
|
51 |
<?php _e('Name', 'wp_all_import_plugin') ?>
|
52 |
<input type="text" name="update_missing_cf_name" value="<?php echo esc_attr($post['update_missing_cf_name']) ?>" />
|
53 |
<?php _e('Value', 'wp_all_import_plugin') ?>
|
54 |
-
<input type="text" name="update_missing_cf_value" value="<?php echo esc_attr($post['update_missing_cf_value']) ?>" />
|
55 |
</div>
|
56 |
</div>
|
57 |
</div>
|
58 |
<div class="input">
|
59 |
<input type="hidden" name="set_missing_to_draft" value="0" />
|
60 |
<input type="checkbox" id="set_missing_to_draft" name="set_missing_to_draft" value="1" <?php echo $post['set_missing_to_draft'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
61 |
-
<label for="set_missing_to_draft"><?php _e('Instead of deletion, change post status to Draft', 'wp_all_import_plugin') ?></label>
|
62 |
</div>
|
63 |
-
|
64 |
-
</div>
|
|
|
65 |
<div class="input">
|
66 |
-
<input type="hidden" id="is_keep_former_posts" name="is_keep_former_posts" value="yes" />
|
67 |
<input type="checkbox" id="is_not_keep_former_posts" name="is_keep_former_posts" value="no" <?php echo "yes" != $post['is_keep_former_posts'] ? 'checked="checked"': '' ?> class="switcher" />
|
68 |
<label for="is_not_keep_former_posts"><?php printf(__('Update existing %s with changed data in your file', 'wp_all_import_plugin'), esc_attr($cpt_name)) ?></label>
|
69 |
<?php if ( $this->isWizard and "new" == $post['wizard_type'] and empty(PMXI_Plugin::$session->deligate)): ?>
|
@@ -77,7 +78,7 @@
|
|
77 |
<label for="is_selective_hashing"><?php printf(__('Skip %s if their data in your file has not changed', 'wp_all_import_plugin'), esc_attr(strtolower($custom_type->labels->name))); ?></label>
|
78 |
<a href="#help" class="wpallimport-help" style="position: relative; top: -2px;" title="<?php _e('When enabled, WP All Import will keep track of every post\'s data as it is imported. When the import is run again, posts will be skipped if their data in the import file has not changed since the last run.<br/><br/>Posts will not be skipped if the import template or settings change, or if you make changes to the custom code in the Function Editor.', 'wp_all_import_plugin') ?>">?</a>
|
79 |
<div class="switcher-target-is_selective_hashing" style="padding-left:17px;">
|
80 |
-
<div class="wpallimport-free-edition-notice" style="margin:
|
81 |
<a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707176&edd_options%5Bprice_id%5D=1&utm_source=import-plugin-free&utm_medium=upgrade-notice&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this option', 'wp_all_import_plugin'); ?></a>
|
82 |
<p style="margin-top:16px;"><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
|
83 |
</div>
|
@@ -86,7 +87,7 @@
|
|
86 |
|
87 |
<input type="radio" id="update_all_data" class="switcher" name="update_all_data" value="yes" <?php echo 'no' != $post['update_all_data'] ? 'checked="checked"': '' ?>/>
|
88 |
<label for="update_all_data"><?php _e('Update all data', 'wp_all_import_plugin' )?></label><br>
|
89 |
-
|
90 |
<input type="radio" id="update_choosen_data" class="switcher" name="update_all_data" value="no" <?php echo 'no' == $post['update_all_data'] ? 'checked="checked"': '' ?>/>
|
91 |
<label for="update_choosen_data"><?php _e('Choose which data to update', 'wp_all_import_plugin' )?></label><br>
|
92 |
<div class="switcher-target-update_choosen_data" style="padding-left:27px;">
|
@@ -169,14 +170,14 @@
|
|
169 |
<input type="hidden" name="is_update_attachments" value="0" />
|
170 |
<input type="checkbox" id="is_update_attachments" name="is_update_attachments" value="1" <?php echo $post['is_update_attachments'] ? 'checked="checked"': '' ?> />
|
171 |
<label for="is_update_attachments"><?php _e('Attachments', 'wp_all_import_plugin') ?></label>
|
172 |
-
</div>
|
173 |
-
|
174 |
-
<?php
|
175 |
|
176 |
// add-ons re-import options
|
177 |
do_action('pmxi_reimport', $post_type, $post);
|
178 |
|
179 |
-
?>
|
180 |
|
181 |
<div class="input">
|
182 |
<input type="hidden" name="is_update_images" value="0" />
|
@@ -184,21 +185,21 @@
|
|
184 |
<label for="is_update_images"><?php _e('Images', 'wp_all_import_plugin') ?></label>
|
185 |
<!--a href="#help" class="wpallimport-help" title="<?php _e('This will keep the featured image if it exists, so you could modify the post image manually, and then do a reimport, and it would not overwrite the manually modified post image.', 'wp_all_import_plugin') ?>">?</a-->
|
186 |
<div class="switcher-target-is_update_images" style="padding-left:17px;">
|
187 |
-
<div class="input" style="margin-bottom:3px;">
|
188 |
<input type="radio" id="update_images_logic_full_update" name="update_images_logic" value="full_update" <?php echo ( "full_update" == $post['update_images_logic'] ) ? 'checked="checked"': '' ?> />
|
189 |
-
<label for="update_images_logic_full_update"><?php _e('Update all images', 'wp_all_import_plugin') ?></label>
|
190 |
</div>
|
191 |
<?php $is_show_add_new_images = apply_filters('wp_all_import_is_show_add_new_images', true, $post_type); ?>
|
192 |
<?php if ($is_show_add_new_images): ?>
|
193 |
-
<div class="input" style="margin-bottom:3px;">
|
194 |
<input type="radio" id="update_images_logic_add_new" name="update_images_logic" value="add_new" <?php echo ( "add_new" == $post['update_images_logic'] ) ? 'checked="checked"': '' ?> />
|
195 |
<label for="update_images_logic_add_new"><?php _e('Don\'t touch existing images, append new images', 'wp_all_import_plugin') ?></label>
|
196 |
</div>
|
197 |
<?php endif; ?>
|
198 |
</div>
|
199 |
-
</div>
|
200 |
-
<div class="input">
|
201 |
-
<input type="hidden" name="custom_fields_list" value="0" />
|
202 |
<input type="hidden" name="is_update_custom_fields" value="0" />
|
203 |
<input type="checkbox" id="is_update_custom_fields" name="is_update_custom_fields" value="1" <?php echo $post['is_update_custom_fields'] ? 'checked="checked"': '' ?> class="switcher"/>
|
204 |
<label for="is_update_custom_fields"><?php _e('Custom Fields', 'wp_all_import_plugin') ?></label>
|
@@ -206,26 +207,26 @@
|
|
206 |
<div class="switcher-target-is_update_custom_fields" style="padding-left:17px;">
|
207 |
<div class="input">
|
208 |
<input type="radio" id="update_custom_fields_logic_full_update" name="update_custom_fields_logic" value="full_update" <?php echo ( "full_update" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
209 |
-
<label for="update_custom_fields_logic_full_update"><?php _e('Update all Custom Fields', 'wp_all_import_plugin') ?></label>
|
210 |
-
</div>
|
211 |
<div class="input">
|
212 |
<input type="radio" id="update_custom_fields_logic_only" name="update_custom_fields_logic" value="only" <?php echo ( "only" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
213 |
-
<label for="update_custom_fields_logic_only"><?php _e('Update only these Custom Fields, leave the rest alone', 'wp_all_import_plugin') ?></label>
|
214 |
-
<div class="switcher-target-update_custom_fields_logic_only pmxi_choosen" style="padding-left:17px;">
|
215 |
<span class="hidden choosen_values"><?php if (!empty($existing_meta_keys)) echo esc_html(implode(',', $existing_meta_keys));?></span>
|
216 |
-
<input class="choosen_input" value="<?php if (!empty($post['custom_fields_list']) and "only" == $post['update_custom_fields_logic']) echo esc_html(implode(',', $post['custom_fields_list'])); ?>" type="hidden" name="custom_fields_only_list"/>
|
217 |
-
</div>
|
218 |
</div>
|
219 |
<div class="input">
|
220 |
<input type="radio" id="update_custom_fields_logic_all_except" name="update_custom_fields_logic" value="all_except" <?php echo ( "all_except" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
221 |
-
<label for="update_custom_fields_logic_all_except"><?php _e('Leave these fields alone, update all other Custom Fields', 'wp_all_import_plugin') ?></label>
|
222 |
-
<div class="switcher-target-update_custom_fields_logic_all_except pmxi_choosen" style="padding-left:17px;">
|
223 |
<span class="hidden choosen_values"><?php if (!empty($existing_meta_keys)) echo esc_html(implode(',', $existing_meta_keys));?></span>
|
224 |
-
<input class="choosen_input" value="<?php if (!empty($post['custom_fields_list']) and "all_except" == $post['update_custom_fields_logic']) echo esc_html(implode(',', $post['custom_fields_list'])); ?>" type="hidden" name="custom_fields_except_list"/>
|
225 |
-
</div>
|
226 |
</div>
|
227 |
</div>
|
228 |
-
</div>
|
229 |
<div class="input">
|
230 |
<input type="hidden" name="taxonomies_list" value="0" />
|
231 |
<input type="hidden" name="is_update_categories" value="0" />
|
@@ -236,42 +237,42 @@
|
|
236 |
$existing_taxonomies = array();
|
237 |
$hide_taxonomies = (class_exists('PMWI_Plugin')) ? array('product_type', 'product_visibility') : array();
|
238 |
$post_taxonomies = array_diff_key(get_taxonomies_by_object_type($post['is_override_post_type'] ? array_keys(get_post_types( '', 'names' )) : array($post_type), 'object'), array_flip($hide_taxonomies));
|
239 |
-
if (!empty($post_taxonomies)):
|
240 |
foreach ($post_taxonomies as $ctx): if ("" == $ctx->labels->name or (class_exists('PMWI_Plugin') and $post_type == "product" and strpos($ctx->name, "pa_") === 0)) continue;
|
241 |
-
$existing_taxonomies[] = $ctx->name;
|
242 |
endforeach;
|
243 |
endif;
|
244 |
?>
|
245 |
-
<div class="input" style="margin-bottom:3px;">
|
246 |
<input type="radio" id="update_categories_logic_all_except" name="update_categories_logic" value="all_except" <?php echo ( "all_except" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
247 |
-
<label for="update_categories_logic_all_except"><?php _e('Leave these taxonomies alone, update all others', 'wp_all_import_plugin') ?></label>
|
248 |
-
<div class="switcher-target-update_categories_logic_all_except pmxi_choosen" style="padding-left:17px;">
|
249 |
<span class="hidden choosen_values"><?php if (!empty($existing_taxonomies)) echo esc_html(implode(',', $existing_taxonomies));?></span>
|
250 |
-
<input class="choosen_input" value="<?php if (!empty($post['taxonomies_list']) and "all_except" == $post['update_categories_logic']) echo esc_html(implode(',', $post['taxonomies_list'])); ?>" type="hidden" name="taxonomies_except_list"/>
|
251 |
-
</div>
|
252 |
</div>
|
253 |
-
<div class="input" style="margin-bottom:3px;">
|
254 |
<input type="radio" id="update_categories_logic_only" name="update_categories_logic" value="only" <?php echo ( "only" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
255 |
-
<label for="update_categories_logic_only"><?php _e('Update only these taxonomies, leave the rest alone', 'wp_all_import_plugin') ?></label>
|
256 |
-
<div class="switcher-target-update_categories_logic_only pmxi_choosen" style="padding-left:17px;">
|
257 |
<span class="hidden choosen_values"><?php if (!empty($existing_taxonomies)) echo esc_html(implode(',', $existing_taxonomies));?></span>
|
258 |
-
<input class="choosen_input" value="<?php if (!empty($post['taxonomies_list']) and "only" == $post['update_categories_logic']) echo esc_html(implode(',', $post['taxonomies_list'])); ?>" type="hidden" name="taxonomies_only_list"/>
|
259 |
-
</div>
|
260 |
</div>
|
261 |
-
<div class="input" style="margin-bottom:3px;">
|
262 |
<input type="radio" id="update_categories_logic_full_update" name="update_categories_logic" value="full_update" <?php echo ( "full_update" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
263 |
<label for="update_categories_logic_full_update"><?php _e('Remove existing taxonomies, add new taxonomies', 'wp_all_import_plugin') ?></label>
|
264 |
</div>
|
265 |
-
<div class="input" style="margin-bottom:3px;">
|
266 |
<input type="radio" id="update_categories_logic_add_new" name="update_categories_logic" value="add_new" <?php echo ( "add_new" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
267 |
<label for="update_categories_logic_add_new"><?php _e('Only add new', 'wp_all_import_plugin') ?></label>
|
268 |
</div>
|
269 |
</div>
|
270 |
-
</div>
|
271 |
<?php
|
272 |
// add-ons re-import options
|
273 |
do_action('pmxi_reimport_options_after_taxonomies', $post_type, $post);
|
274 |
?>
|
275 |
</div>
|
276 |
</div>
|
277 |
-
</div>
|
29 |
<label for="is_delete_missing" <?php if ( "new" != $post['wizard_type']): ?>style="color:#ccc;"<?php endif; ?>><?php printf(__('Delete %s that are no longer present in your file', 'wp_all_import_plugin'), esc_attr($cpt_name)) ?></label>
|
30 |
<?php if ( "new" != $post['wizard_type']): ?>
|
31 |
<a href="#help" class="wpallimport-help" title="<?php _e('Records removed from the import file can only be deleted when importing into New Items. This feature cannot be enabled when importing into Existing Items.', 'wp_all_import_plugin') ?>" style="position:relative; top: -1px;">?</a>
|
32 |
+
<?php endif; ?>
|
33 |
</div>
|
34 |
<div class="switcher-target-is_delete_missing" style="padding-left:17px;">
|
35 |
<div class="input">
|
36 |
<input type="hidden" name="is_keep_attachments" value="0" />
|
37 |
<input type="checkbox" id="is_keep_attachments" name="is_keep_attachments" value="1" <?php echo $post['is_keep_attachments'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
38 |
+
<label for="is_keep_attachments"><?php _e('Do not remove attachments', 'wp_all_import_plugin') ?></label>
|
39 |
</div>
|
40 |
<div class="input">
|
41 |
<input type="hidden" name="is_keep_imgs" value="0" />
|
42 |
<input type="checkbox" id="is_keep_imgs" name="is_keep_imgs" value="1" <?php echo $post['is_keep_imgs'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
43 |
+
<label for="is_keep_imgs"><?php _e('Do not remove images', 'wp_all_import_plugin') ?></label>
|
44 |
</div>
|
45 |
<div class="input">
|
46 |
<input type="hidden" name="is_update_missing_cf" value="0" />
|
47 |
<input type="checkbox" id="is_update_missing_cf" name="is_update_missing_cf" value="1" <?php echo $post['is_update_missing_cf'] ? 'checked="checked"': '' ?> class="switcher" <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
48 |
+
<label for="is_update_missing_cf"><?php _e('Instead of deletion, set Custom Field', 'wp_all_import_plugin') ?></label>
|
49 |
<div class="switcher-target-is_update_missing_cf" style="padding-left:17px;">
|
50 |
<div class="input">
|
51 |
<?php _e('Name', 'wp_all_import_plugin') ?>
|
52 |
<input type="text" name="update_missing_cf_name" value="<?php echo esc_attr($post['update_missing_cf_name']) ?>" />
|
53 |
<?php _e('Value', 'wp_all_import_plugin') ?>
|
54 |
+
<input type="text" name="update_missing_cf_value" value="<?php echo esc_attr($post['update_missing_cf_value']) ?>" />
|
55 |
</div>
|
56 |
</div>
|
57 |
</div>
|
58 |
<div class="input">
|
59 |
<input type="hidden" name="set_missing_to_draft" value="0" />
|
60 |
<input type="checkbox" id="set_missing_to_draft" name="set_missing_to_draft" value="1" <?php echo $post['set_missing_to_draft'] ? 'checked="checked"': '' ?> <?php if ( "new" != $post['wizard_type']): ?>disabled="disabled"<?php endif; ?>/>
|
61 |
+
<label for="set_missing_to_draft"><?php _e('Instead of deletion, change post status to Draft', 'wp_all_import_plugin') ?></label>
|
62 |
</div>
|
63 |
+
<?php do_action('wp_all_import_delete_missing_options', $post_type, $post); ?>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
<div class="input">
|
67 |
+
<input type="hidden" id="is_keep_former_posts" name="is_keep_former_posts" value="yes" />
|
68 |
<input type="checkbox" id="is_not_keep_former_posts" name="is_keep_former_posts" value="no" <?php echo "yes" != $post['is_keep_former_posts'] ? 'checked="checked"': '' ?> class="switcher" />
|
69 |
<label for="is_not_keep_former_posts"><?php printf(__('Update existing %s with changed data in your file', 'wp_all_import_plugin'), esc_attr($cpt_name)) ?></label>
|
70 |
<?php if ( $this->isWizard and "new" == $post['wizard_type'] and empty(PMXI_Plugin::$session->deligate)): ?>
|
78 |
<label for="is_selective_hashing"><?php printf(__('Skip %s if their data in your file has not changed', 'wp_all_import_plugin'), esc_attr(strtolower($custom_type->labels->name))); ?></label>
|
79 |
<a href="#help" class="wpallimport-help" style="position: relative; top: -2px;" title="<?php _e('When enabled, WP All Import will keep track of every post\'s data as it is imported. When the import is run again, posts will be skipped if their data in the import file has not changed since the last run.<br/><br/>Posts will not be skipped if the import template or settings change, or if you make changes to the custom code in the Function Editor.', 'wp_all_import_plugin') ?>">?</a>
|
80 |
<div class="switcher-target-is_selective_hashing" style="padding-left:17px;">
|
81 |
+
<div class="wpallimport-free-edition-notice" style="margin: 0 0 30px 7px;">
|
82 |
<a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707176&edd_options%5Bprice_id%5D=1&utm_source=import-plugin-free&utm_medium=upgrade-notice&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this option', 'wp_all_import_plugin'); ?></a>
|
83 |
<p style="margin-top:16px;"><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
|
84 |
</div>
|
87 |
|
88 |
<input type="radio" id="update_all_data" class="switcher" name="update_all_data" value="yes" <?php echo 'no' != $post['update_all_data'] ? 'checked="checked"': '' ?>/>
|
89 |
<label for="update_all_data"><?php _e('Update all data', 'wp_all_import_plugin' )?></label><br>
|
90 |
+
|
91 |
<input type="radio" id="update_choosen_data" class="switcher" name="update_all_data" value="no" <?php echo 'no' == $post['update_all_data'] ? 'checked="checked"': '' ?>/>
|
92 |
<label for="update_choosen_data"><?php _e('Choose which data to update', 'wp_all_import_plugin' )?></label><br>
|
93 |
<div class="switcher-target-update_choosen_data" style="padding-left:27px;">
|
170 |
<input type="hidden" name="is_update_attachments" value="0" />
|
171 |
<input type="checkbox" id="is_update_attachments" name="is_update_attachments" value="1" <?php echo $post['is_update_attachments'] ? 'checked="checked"': '' ?> />
|
172 |
<label for="is_update_attachments"><?php _e('Attachments', 'wp_all_import_plugin') ?></label>
|
173 |
+
</div>
|
174 |
+
|
175 |
+
<?php
|
176 |
|
177 |
// add-ons re-import options
|
178 |
do_action('pmxi_reimport', $post_type, $post);
|
179 |
|
180 |
+
?>
|
181 |
|
182 |
<div class="input">
|
183 |
<input type="hidden" name="is_update_images" value="0" />
|
185 |
<label for="is_update_images"><?php _e('Images', 'wp_all_import_plugin') ?></label>
|
186 |
<!--a href="#help" class="wpallimport-help" title="<?php _e('This will keep the featured image if it exists, so you could modify the post image manually, and then do a reimport, and it would not overwrite the manually modified post image.', 'wp_all_import_plugin') ?>">?</a-->
|
187 |
<div class="switcher-target-is_update_images" style="padding-left:17px;">
|
188 |
+
<div class="input" style="margin-bottom:3px;">
|
189 |
<input type="radio" id="update_images_logic_full_update" name="update_images_logic" value="full_update" <?php echo ( "full_update" == $post['update_images_logic'] ) ? 'checked="checked"': '' ?> />
|
190 |
+
<label for="update_images_logic_full_update"><?php _e('Update all images', 'wp_all_import_plugin') ?></label>
|
191 |
</div>
|
192 |
<?php $is_show_add_new_images = apply_filters('wp_all_import_is_show_add_new_images', true, $post_type); ?>
|
193 |
<?php if ($is_show_add_new_images): ?>
|
194 |
+
<div class="input" style="margin-bottom:3px;">
|
195 |
<input type="radio" id="update_images_logic_add_new" name="update_images_logic" value="add_new" <?php echo ( "add_new" == $post['update_images_logic'] ) ? 'checked="checked"': '' ?> />
|
196 |
<label for="update_images_logic_add_new"><?php _e('Don\'t touch existing images, append new images', 'wp_all_import_plugin') ?></label>
|
197 |
</div>
|
198 |
<?php endif; ?>
|
199 |
</div>
|
200 |
+
</div>
|
201 |
+
<div class="input">
|
202 |
+
<input type="hidden" name="custom_fields_list" value="0" />
|
203 |
<input type="hidden" name="is_update_custom_fields" value="0" />
|
204 |
<input type="checkbox" id="is_update_custom_fields" name="is_update_custom_fields" value="1" <?php echo $post['is_update_custom_fields'] ? 'checked="checked"': '' ?> class="switcher"/>
|
205 |
<label for="is_update_custom_fields"><?php _e('Custom Fields', 'wp_all_import_plugin') ?></label>
|
207 |
<div class="switcher-target-is_update_custom_fields" style="padding-left:17px;">
|
208 |
<div class="input">
|
209 |
<input type="radio" id="update_custom_fields_logic_full_update" name="update_custom_fields_logic" value="full_update" <?php echo ( "full_update" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
210 |
+
<label for="update_custom_fields_logic_full_update"><?php _e('Update all Custom Fields', 'wp_all_import_plugin') ?></label>
|
211 |
+
</div>
|
212 |
<div class="input">
|
213 |
<input type="radio" id="update_custom_fields_logic_only" name="update_custom_fields_logic" value="only" <?php echo ( "only" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
214 |
+
<label for="update_custom_fields_logic_only"><?php _e('Update only these Custom Fields, leave the rest alone', 'wp_all_import_plugin') ?></label>
|
215 |
+
<div class="switcher-target-update_custom_fields_logic_only pmxi_choosen" style="padding-left:17px;">
|
216 |
<span class="hidden choosen_values"><?php if (!empty($existing_meta_keys)) echo esc_html(implode(',', $existing_meta_keys));?></span>
|
217 |
+
<input class="choosen_input" value="<?php if (!empty($post['custom_fields_list']) and "only" == $post['update_custom_fields_logic']) echo esc_html(implode(',', $post['custom_fields_list'])); ?>" type="hidden" name="custom_fields_only_list"/>
|
218 |
+
</div>
|
219 |
</div>
|
220 |
<div class="input">
|
221 |
<input type="radio" id="update_custom_fields_logic_all_except" name="update_custom_fields_logic" value="all_except" <?php echo ( "all_except" == $post['update_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
222 |
+
<label for="update_custom_fields_logic_all_except"><?php _e('Leave these fields alone, update all other Custom Fields', 'wp_all_import_plugin') ?></label>
|
223 |
+
<div class="switcher-target-update_custom_fields_logic_all_except pmxi_choosen" style="padding-left:17px;">
|
224 |
<span class="hidden choosen_values"><?php if (!empty($existing_meta_keys)) echo esc_html(implode(',', $existing_meta_keys));?></span>
|
225 |
+
<input class="choosen_input" value="<?php if (!empty($post['custom_fields_list']) and "all_except" == $post['update_custom_fields_logic']) echo esc_html(implode(',', $post['custom_fields_list'])); ?>" type="hidden" name="custom_fields_except_list"/>
|
226 |
+
</div>
|
227 |
</div>
|
228 |
</div>
|
229 |
+
</div>
|
230 |
<div class="input">
|
231 |
<input type="hidden" name="taxonomies_list" value="0" />
|
232 |
<input type="hidden" name="is_update_categories" value="0" />
|
237 |
$existing_taxonomies = array();
|
238 |
$hide_taxonomies = (class_exists('PMWI_Plugin')) ? array('product_type', 'product_visibility') : array();
|
239 |
$post_taxonomies = array_diff_key(get_taxonomies_by_object_type($post['is_override_post_type'] ? array_keys(get_post_types( '', 'names' )) : array($post_type), 'object'), array_flip($hide_taxonomies));
|
240 |
+
if (!empty($post_taxonomies)):
|
241 |
foreach ($post_taxonomies as $ctx): if ("" == $ctx->labels->name or (class_exists('PMWI_Plugin') and $post_type == "product" and strpos($ctx->name, "pa_") === 0)) continue;
|
242 |
+
$existing_taxonomies[] = $ctx->name;
|
243 |
endforeach;
|
244 |
endif;
|
245 |
?>
|
246 |
+
<div class="input" style="margin-bottom:3px;">
|
247 |
<input type="radio" id="update_categories_logic_all_except" name="update_categories_logic" value="all_except" <?php echo ( "all_except" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
248 |
+
<label for="update_categories_logic_all_except"><?php _e('Leave these taxonomies alone, update all others', 'wp_all_import_plugin') ?></label>
|
249 |
+
<div class="switcher-target-update_categories_logic_all_except pmxi_choosen" style="padding-left:17px;">
|
250 |
<span class="hidden choosen_values"><?php if (!empty($existing_taxonomies)) echo esc_html(implode(',', $existing_taxonomies));?></span>
|
251 |
+
<input class="choosen_input" value="<?php if (!empty($post['taxonomies_list']) and "all_except" == $post['update_categories_logic']) echo esc_html(implode(',', $post['taxonomies_list'])); ?>" type="hidden" name="taxonomies_except_list"/>
|
252 |
+
</div>
|
253 |
</div>
|
254 |
+
<div class="input" style="margin-bottom:3px;">
|
255 |
<input type="radio" id="update_categories_logic_only" name="update_categories_logic" value="only" <?php echo ( "only" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
256 |
+
<label for="update_categories_logic_only"><?php _e('Update only these taxonomies, leave the rest alone', 'wp_all_import_plugin') ?></label>
|
257 |
+
<div class="switcher-target-update_categories_logic_only pmxi_choosen" style="padding-left:17px;">
|
258 |
<span class="hidden choosen_values"><?php if (!empty($existing_taxonomies)) echo esc_html(implode(',', $existing_taxonomies));?></span>
|
259 |
+
<input class="choosen_input" value="<?php if (!empty($post['taxonomies_list']) and "only" == $post['update_categories_logic']) echo esc_html(implode(',', $post['taxonomies_list'])); ?>" type="hidden" name="taxonomies_only_list"/>
|
260 |
+
</div>
|
261 |
</div>
|
262 |
+
<div class="input" style="margin-bottom:3px;">
|
263 |
<input type="radio" id="update_categories_logic_full_update" name="update_categories_logic" value="full_update" <?php echo ( "full_update" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
264 |
<label for="update_categories_logic_full_update"><?php _e('Remove existing taxonomies, add new taxonomies', 'wp_all_import_plugin') ?></label>
|
265 |
</div>
|
266 |
+
<div class="input" style="margin-bottom:3px;">
|
267 |
<input type="radio" id="update_categories_logic_add_new" name="update_categories_logic" value="add_new" <?php echo ( "add_new" == $post['update_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
|
268 |
<label for="update_categories_logic_add_new"><?php _e('Only add new', 'wp_all_import_plugin') ?></label>
|
269 |
</div>
|
270 |
</div>
|
271 |
+
</div>
|
272 |
<?php
|
273 |
// add-ons re-import options
|
274 |
do_action('pmxi_reimport_options_after_taxonomies', $post_type, $post);
|
275 |
?>
|
276 |
</div>
|
277 |
</div>
|
278 |
+
</div>
|
views/admin/import/template.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<h2 class="wpallimport-wp-notices"></h2>
|
2 |
|
3 |
-
<form class="wpallimport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallimport-step-3" method="post">
|
4 |
-
|
5 |
<div class="wpallimport-wrapper">
|
6 |
<div class="wpallimport-header">
|
7 |
<div class="wpallimport-logo"></div>
|
@@ -11,16 +11,16 @@
|
|
11 |
<div class="wpallimport-links">
|
12 |
<a href="http://www.wpallimport.com/support/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=premium-support" target="_blank"><?php _e('Support', 'wp_all_import_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=docs" target="_blank"><?php _e('Documentation', 'wp_all_import_plugin'); ?></a>
|
13 |
</div>
|
14 |
-
</div>
|
15 |
<div class="clear"></div>
|
16 |
-
</div>
|
17 |
|
18 |
<?php $visible_sections = apply_filters('pmxi_visible_template_sections', array('caption', 'main', 'taxonomies', 'cf', 'featured', 'other', 'nested'), $post['custom_type']); ?>
|
19 |
|
20 |
<table class="wpallimport-layout">
|
21 |
<tr>
|
22 |
<td class="left">
|
23 |
-
|
24 |
<?php do_action('pmxi_template_header', $this->isWizard, $post); ?>
|
25 |
|
26 |
<?php if ($this->errors->get_error_codes()): ?>
|
@@ -29,10 +29,10 @@
|
|
29 |
<?php if ($this->warnings->get_error_codes()): ?>
|
30 |
<?php $this->warning() ?>
|
31 |
<?php endif ?>
|
32 |
-
|
33 |
<?php $post_type = $post['custom_type'];?>
|
34 |
|
35 |
-
<?php if ( in_array('caption', $visible_sections) ): ?>
|
36 |
|
37 |
<div class="wpallimport-collapsed wpallimport-section">
|
38 |
<div class="wpallimport-content-section" style="overflow: hidden; padding-bottom: 0;">
|
@@ -45,29 +45,29 @@
|
|
45 |
<h3><?php _e('Title & Content', 'wp_all_import_plugin'); ?></h3>
|
46 |
<?php } ?>
|
47 |
</div>
|
48 |
-
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
49 |
-
|
50 |
<div style="padding: 15px 25px 65px;">
|
51 |
<div id="titlediv" style="margin-bottom:20px;">
|
52 |
<div id="titlewrap">
|
53 |
-
<input id="wpallimport-title" class="widefat" type="text" name="title" value="<?php echo esc_attr(
|
54 |
</div>
|
55 |
</div>
|
56 |
-
|
57 |
<div id="poststuff" style="margin-top:-25px;">
|
58 |
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
59 |
|
60 |
-
<?php wp_editor(
|
61 |
-
//'teeny' => true,
|
62 |
'editor_class' => 'wpallimport-plugin-editor',
|
63 |
-
'media_buttons' => false,
|
64 |
-
'editor_height' => 200));
|
65 |
?>
|
66 |
-
|
67 |
</div>
|
68 |
-
</div>
|
69 |
|
70 |
-
<?php if ( post_type_supports( $post_type, 'excerpt' ) ):?>
|
71 |
<div class="template_input">
|
72 |
<?php if ($post_type == 'product' and class_exists('PMWI_Plugin')): ?>
|
73 |
<h3><?php _e('Short Description', 'wp_all_import_plugin'); ?></h3>
|
@@ -76,30 +76,30 @@
|
|
76 |
<input type="text" name="post_excerpt" style="width:100%; line-height: 25px;" value="<?php echo esc_attr($post['post_excerpt']) ?>" placeholder="<?php _e('Excerpt', 'wp_all_import_plugin'); ?>"/>
|
77 |
<?php endif; ?>
|
78 |
</div>
|
79 |
-
<?php endif; ?>
|
80 |
-
|
81 |
<a class="preview" href="javascript:void(0);" rel="preview"><?php _e('Preview', 'wp_all_import_plugin'); ?></a>
|
82 |
</div>
|
83 |
|
84 |
<div class="wpallimport-collapsed closed wpallimport-section">
|
85 |
<div class="wpallimport-content-section rad0" style="margin:0; border-top:1px solid #ddd; border-bottom: none; border-right: none; border-left: none; background: #f1f2f2;">
|
86 |
<div class="wpallimport-collapsed-header">
|
87 |
-
<h3 style="color:#40acad;"><?php _e('Advanced Options','wp_all_import_plugin');?></h3>
|
88 |
</div>
|
89 |
-
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
90 |
-
<div class="wpallimport-collapsed-content-inner">
|
91 |
-
<div class="input pmxi_option">
|
92 |
<input type="hidden" name="is_keep_linebreaks" value="0" />
|
93 |
<input type="checkbox" id="is_keep_linebreaks" name="is_keep_linebreaks" class="fix_checkbox" value="1" <?php echo $post['is_keep_linebreaks'] ? 'checked="checked"' : '' ?> />
|
94 |
-
<label for="is_keep_linebreaks"><?php _e('Keep line breaks from file', 'wp_all_import_plugin') ?></label>
|
95 |
-
</div>
|
96 |
-
<div class="input pmxi_option">
|
97 |
<input type="hidden" name="is_leave_html" value="0" />
|
98 |
<input type="checkbox" id="is_leave_html" name="is_leave_html" class="fix_checkbox" value="1" <?php echo $post['is_leave_html'] ? 'checked="checked"' : '' ?> style="position:relative;"/>
|
99 |
<label for="is_leave_html"><?php _e('Decode HTML entities with <b>html_entity_decode</b>', 'wp_all_import_plugin') ?></label>
|
100 |
<a class="wpallimport-help" href="#help" style="position:relative; top:1px;" title="If HTML code is showing up in your posts, use this option. You can also use <br /><br /><i>[html_entity_decode({my/xpath})]</i><br /><br /> or <br /><br /><i>[htmlentities({my/xpath})]</i><br /><br /> or <br /><br /><i>[htmlspecialchars_decode({my/xpath})]</i><br /><br /> to decode or encode HTML in your file.">?</a>
|
101 |
-
</div>
|
102 |
-
</div>
|
103 |
</div>
|
104 |
</div>
|
105 |
</div>
|
@@ -109,60 +109,60 @@
|
|
109 |
|
110 |
<?php endif; ?>
|
111 |
|
112 |
-
<input type="hidden" name="custom_type" value="<?php echo
|
113 |
-
<input type="hidden" name="type" value="<?php echo ($post['custom_type'] == 'page') ? 'page' : 'post'; ?>"/>
|
114 |
-
|
115 |
-
<?php
|
116 |
|
117 |
if ( in_array('main', $visible_sections) ) do_action('pmxi_extend_options_main', $post_type, $post);
|
118 |
|
119 |
if ( in_array('featured', $visible_sections) ) {
|
120 |
-
$is_images_section_enabled = apply_filters('wp_all_import_is_images_section_enabled', true, $post_type);
|
121 |
if ( $is_images_section_enabled ) {
|
122 |
PMXI_API::add_additional_images_section(__('Images', 'wp_all_import_plugin'), '', $post, $post_type, true, true);
|
123 |
}
|
124 |
-
|
125 |
do_action('pmxi_extend_options_featured', $post_type, $post);
|
126 |
}
|
127 |
|
128 |
-
if ( in_array('cf', $visible_sections) ){
|
129 |
include( 'template/_custom_fields_template.php' );
|
130 |
-
do_action('pmxi_extend_options_custom_fields', $post_type, $post);
|
131 |
}
|
132 |
|
133 |
if ( in_array('taxonomies', $visible_sections) ) {
|
134 |
-
include( 'template/_taxonomies_template.php' );
|
135 |
-
do_action('pmxi_extend_options_taxonomies', $post_type, $post);
|
136 |
-
}
|
137 |
|
138 |
-
if ( in_array('other', $visible_sections) ){
|
139 |
include( 'template/_other_template.php' );
|
140 |
do_action('pmxi_extend_options_other', $post_type, $post);
|
141 |
}
|
142 |
|
143 |
-
/*if ( in_array('nested', $visible_sections) ){
|
144 |
include( 'template/_nested_template.php' );
|
145 |
do_action('pmxi_extend_options_nested', $post_type);
|
146 |
}*/
|
147 |
|
148 |
$uploads = wp_upload_dir();
|
149 |
-
$functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
|
150 |
-
|
151 |
?>
|
152 |
|
153 |
<div class="wpallimport-collapsed closed wpallimport-section">
|
154 |
<div class="wpallimport-content-section">
|
155 |
<div class="wpallimport-collapsed-header">
|
156 |
-
<h3><?php _e('Function Editor', 'wp_all_import_plugin'); ?></h3>
|
157 |
</div>
|
158 |
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
159 |
-
<div class="wpallimport-collapsed-content-inner">
|
160 |
<div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
|
161 |
<a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707176&edd_options%5Bprice_id%5D=1&utm_source=import-plugin-free&utm_medium=upgrade-notice&utm_campaign=function-editor" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use the Function Editor', 'wp_all_import_plugin');?></a>
|
162 |
<p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
|
163 |
</div>
|
164 |
-
|
165 |
-
<textarea id="wp_all_import_code" name="wp_all_import_code"><?php echo "<?php\n\n?>";?></textarea>
|
166 |
|
167 |
<div class="input" style="margin-top: 10px;">
|
168 |
|
@@ -170,7 +170,7 @@
|
|
170 |
<input type="button" class="button-primary wp_all_import_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_import_plugin'); ?>"/>
|
171 |
<a href="#help" class="wpallimport-help" title="<?php printf(__("Add functions here for use during your import. You can access this file at %s", "wp_all_import_plugin"), esc_attr(preg_replace("%.*wp-content%", "wp-content", $functions)));?>" style="top: 0;">?</a>
|
172 |
<div class="wp_all_import_functions_preloader"></div>
|
173 |
-
</div>
|
174 |
<div class="input wp_all_import_saving_status" style="display:inline-block;">
|
175 |
|
176 |
</div>
|
@@ -180,40 +180,40 @@
|
|
180 |
</div>
|
181 |
</div>
|
182 |
</div>
|
183 |
-
</div>
|
184 |
-
|
185 |
<hr>
|
186 |
-
|
187 |
<div class="input wpallimport-section load-template-container" style="padding-bottom: 8px; padding-left: 8px;">
|
188 |
|
189 |
-
<?php
|
190 |
-
wp_all_import_template_notifications( $post, 'notice' );
|
191 |
-
?>
|
192 |
-
|
193 |
<p style="margin: 11px; float: left;">
|
194 |
<input type="hidden" name="save_template_as" value="0" />
|
195 |
-
<input type="checkbox" id="save_template_as" name="save_template_as" class="switcher-horizontal fix_checkbox" value="1" <?php echo ( ! empty($post['save_template_as'])) ? 'checked="checked"' : '' ?> />
|
196 |
<label for="save_template_as"><?php _e('Save settings as a template','wp_all_import_plugin');?></label>
|
197 |
</p>
|
198 |
<div class="switcher-target-save_template_as" style="float: left; overflow: hidden;">
|
199 |
-
<input type="text" name="name" placeholder="<?php _e('Template name...', 'wp_all_import_plugin') ?>" style="vertical-align:middle; line-height: 26px;" value="<?php echo esc_attr($post['name']) ?>" />
|
200 |
-
</div>
|
201 |
<?php $templates = new PMXI_Template_List(); ?>
|
202 |
-
<div class="load-template">
|
203 |
<select name="load_template" id="load_template">
|
204 |
<option value=""><?php _e('Load Template...', 'wp_all_import_plugin') ?></option>
|
205 |
<?php foreach ($templates->getBy()->convertRecords() as $t): ?>
|
206 |
-
<option value="<?php echo
|
207 |
<?php endforeach ?>
|
208 |
</select>
|
209 |
</div>
|
210 |
-
|
211 |
</div>
|
212 |
|
213 |
<hr>
|
214 |
|
215 |
<div class="wpallimport-submit-buttons">
|
216 |
-
|
217 |
<div style="text-align:center; width:100%;">
|
218 |
|
219 |
<div class="wpallimport-free-edition-notice wpallimport-dynamic-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
|
@@ -226,21 +226,21 @@
|
|
226 |
|
227 |
<?php wp_nonce_field('template', '_wpnonce_template'); ?>
|
228 |
|
229 |
-
<input type="hidden" name="is_submitted" value="1" />
|
230 |
-
<input type="hidden" name="security" value="<?php echo wp_create_nonce( "wp_all_import_preview" ); ?>" />
|
231 |
|
232 |
<?php if ($this->isWizard):?>
|
233 |
-
<a href="<?php echo esc_url(add_query_arg('action', 'element', $this->baseUrl))
|
234 |
<?php else: ?>
|
235 |
<a href="<?php echo esc_url(remove_query_arg('id', remove_query_arg('action', $this->baseUrl))); ?>" class="back rad3" style="float:none;"><?php _e('Back to Manage Imports', 'wp_all_import_plugin') ?></a>
|
236 |
-
<?php endif; ?>
|
237 |
<input type="submit" class="button button-primary button-hero wpallimport-large-button" value="<?php _e( ($this->isWizard) ? 'Continue to Step 4' : 'Update Template', 'wp_all_import_plugin') ?>" />
|
238 |
</div>
|
239 |
|
240 |
</div>
|
241 |
|
242 |
<a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
|
243 |
-
|
244 |
</td>
|
245 |
<?php if ($this->isWizard or $this->isTemplateEdit): ?>
|
246 |
<td class="right template-sidebar">
|
@@ -250,6 +250,6 @@
|
|
250 |
</td>
|
251 |
<?php endif ?>
|
252 |
</tr>
|
253 |
-
</table>
|
254 |
|
255 |
</form>
|
1 |
<h2 class="wpallimport-wp-notices"></h2>
|
2 |
|
3 |
+
<form class="wpallimport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallimport-step-3" method="post">
|
4 |
+
|
5 |
<div class="wpallimport-wrapper">
|
6 |
<div class="wpallimport-header">
|
7 |
<div class="wpallimport-logo"></div>
|
11 |
<div class="wpallimport-links">
|
12 |
<a href="http://www.wpallimport.com/support/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=premium-support" target="_blank"><?php _e('Support', 'wp_all_import_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=docs" target="_blank"><?php _e('Documentation', 'wp_all_import_plugin'); ?></a>
|
13 |
</div>
|
14 |
+
</div>
|
15 |
<div class="clear"></div>
|
16 |
+
</div>
|
17 |
|
18 |
<?php $visible_sections = apply_filters('pmxi_visible_template_sections', array('caption', 'main', 'taxonomies', 'cf', 'featured', 'other', 'nested'), $post['custom_type']); ?>
|
19 |
|
20 |
<table class="wpallimport-layout">
|
21 |
<tr>
|
22 |
<td class="left">
|
23 |
+
|
24 |
<?php do_action('pmxi_template_header', $this->isWizard, $post); ?>
|
25 |
|
26 |
<?php if ($this->errors->get_error_codes()): ?>
|
29 |
<?php if ($this->warnings->get_error_codes()): ?>
|
30 |
<?php $this->warning() ?>
|
31 |
<?php endif ?>
|
32 |
+
|
33 |
<?php $post_type = $post['custom_type'];?>
|
34 |
|
35 |
+
<?php if ( in_array('caption', $visible_sections) ): ?>
|
36 |
|
37 |
<div class="wpallimport-collapsed wpallimport-section">
|
38 |
<div class="wpallimport-content-section" style="overflow: hidden; padding-bottom: 0;">
|
45 |
<h3><?php _e('Title & Content', 'wp_all_import_plugin'); ?></h3>
|
46 |
<?php } ?>
|
47 |
</div>
|
48 |
+
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
49 |
+
|
50 |
<div style="padding: 15px 25px 65px;">
|
51 |
<div id="titlediv" style="margin-bottom:20px;">
|
52 |
<div id="titlewrap">
|
53 |
+
<input id="wpallimport-title" class="widefat" type="text" name="title" value="<?php echo esc_attr($post['title']) ?>" placeholder="<?php _e('Drag & drop any element on the right to set the title.', 'wp_all_import_plugin'); ?>"/>
|
54 |
</div>
|
55 |
</div>
|
56 |
+
|
57 |
<div id="poststuff" style="margin-top:-25px;">
|
58 |
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
59 |
|
60 |
+
<?php wp_editor($post['content'], 'content', array(
|
61 |
+
//'teeny' => true,
|
62 |
'editor_class' => 'wpallimport-plugin-editor',
|
63 |
+
'media_buttons' => false,
|
64 |
+
'editor_height' => 200));
|
65 |
?>
|
66 |
+
|
67 |
</div>
|
68 |
+
</div>
|
69 |
|
70 |
+
<?php if ( post_type_supports( $post_type, 'excerpt' ) ):?>
|
71 |
<div class="template_input">
|
72 |
<?php if ($post_type == 'product' and class_exists('PMWI_Plugin')): ?>
|
73 |
<h3><?php _e('Short Description', 'wp_all_import_plugin'); ?></h3>
|
76 |
<input type="text" name="post_excerpt" style="width:100%; line-height: 25px;" value="<?php echo esc_attr($post['post_excerpt']) ?>" placeholder="<?php _e('Excerpt', 'wp_all_import_plugin'); ?>"/>
|
77 |
<?php endif; ?>
|
78 |
</div>
|
79 |
+
<?php endif; ?>
|
80 |
+
|
81 |
<a class="preview" href="javascript:void(0);" rel="preview"><?php _e('Preview', 'wp_all_import_plugin'); ?></a>
|
82 |
</div>
|
83 |
|
84 |
<div class="wpallimport-collapsed closed wpallimport-section">
|
85 |
<div class="wpallimport-content-section rad0" style="margin:0; border-top:1px solid #ddd; border-bottom: none; border-right: none; border-left: none; background: #f1f2f2;">
|
86 |
<div class="wpallimport-collapsed-header">
|
87 |
+
<h3 style="color:#40acad;"><?php _e('Advanced Options','wp_all_import_plugin');?></h3>
|
88 |
</div>
|
89 |
+
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
90 |
+
<div class="wpallimport-collapsed-content-inner">
|
91 |
+
<div class="input pmxi_option">
|
92 |
<input type="hidden" name="is_keep_linebreaks" value="0" />
|
93 |
<input type="checkbox" id="is_keep_linebreaks" name="is_keep_linebreaks" class="fix_checkbox" value="1" <?php echo $post['is_keep_linebreaks'] ? 'checked="checked"' : '' ?> />
|
94 |
+
<label for="is_keep_linebreaks"><?php _e('Keep line breaks from file', 'wp_all_import_plugin') ?></label>
|
95 |
+
</div>
|
96 |
+
<div class="input pmxi_option">
|
97 |
<input type="hidden" name="is_leave_html" value="0" />
|
98 |
<input type="checkbox" id="is_leave_html" name="is_leave_html" class="fix_checkbox" value="1" <?php echo $post['is_leave_html'] ? 'checked="checked"' : '' ?> style="position:relative;"/>
|
99 |
<label for="is_leave_html"><?php _e('Decode HTML entities with <b>html_entity_decode</b>', 'wp_all_import_plugin') ?></label>
|
100 |
<a class="wpallimport-help" href="#help" style="position:relative; top:1px;" title="If HTML code is showing up in your posts, use this option. You can also use <br /><br /><i>[html_entity_decode({my/xpath})]</i><br /><br /> or <br /><br /><i>[htmlentities({my/xpath})]</i><br /><br /> or <br /><br /><i>[htmlspecialchars_decode({my/xpath})]</i><br /><br /> to decode or encode HTML in your file.">?</a>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
</div>
|
104 |
</div>
|
105 |
</div>
|
109 |
|
110 |
<?php endif; ?>
|
111 |
|
112 |
+
<input type="hidden" name="custom_type" value="<?php echo $post['custom_type']; ?>"/>
|
113 |
+
<input type="hidden" name="type" value="<?php echo ($post['custom_type'] == 'page') ? 'page' : 'post'; ?>"/>
|
114 |
+
|
115 |
+
<?php
|
116 |
|
117 |
if ( in_array('main', $visible_sections) ) do_action('pmxi_extend_options_main', $post_type, $post);
|
118 |
|
119 |
if ( in_array('featured', $visible_sections) ) {
|
120 |
+
$is_images_section_enabled = apply_filters('wp_all_import_is_images_section_enabled', true, $post_type);
|
121 |
if ( $is_images_section_enabled ) {
|
122 |
PMXI_API::add_additional_images_section(__('Images', 'wp_all_import_plugin'), '', $post, $post_type, true, true);
|
123 |
}
|
124 |
+
|
125 |
do_action('pmxi_extend_options_featured', $post_type, $post);
|
126 |
}
|
127 |
|
128 |
+
if ( in_array('cf', $visible_sections) ){
|
129 |
include( 'template/_custom_fields_template.php' );
|
130 |
+
do_action('pmxi_extend_options_custom_fields', $post_type, $post);
|
131 |
}
|
132 |
|
133 |
if ( in_array('taxonomies', $visible_sections) ) {
|
134 |
+
include( 'template/_taxonomies_template.php' );
|
135 |
+
do_action('pmxi_extend_options_taxonomies', $post_type, $post);
|
136 |
+
}
|
137 |
|
138 |
+
if ( in_array('other', $visible_sections) ){
|
139 |
include( 'template/_other_template.php' );
|
140 |
do_action('pmxi_extend_options_other', $post_type, $post);
|
141 |
}
|
142 |
|
143 |
+
/*if ( in_array('nested', $visible_sections) ){
|
144 |
include( 'template/_nested_template.php' );
|
145 |
do_action('pmxi_extend_options_nested', $post_type);
|
146 |
}*/
|
147 |
|
148 |
$uploads = wp_upload_dir();
|
149 |
+
$functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
|
150 |
+
|
151 |
?>
|
152 |
|
153 |
<div class="wpallimport-collapsed closed wpallimport-section">
|
154 |
<div class="wpallimport-content-section">
|
155 |
<div class="wpallimport-collapsed-header">
|
156 |
+
<h3><?php _e('Function Editor', 'wp_all_import_plugin'); ?></h3>
|
157 |
</div>
|
158 |
<div class="wpallimport-collapsed-content" style="padding: 0;">
|
159 |
+
<div class="wpallimport-collapsed-content-inner">
|
160 |
<div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
|
161 |
<a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707176&edd_options%5Bprice_id%5D=1&utm_source=import-plugin-free&utm_medium=upgrade-notice&utm_campaign=function-editor" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use the Function Editor', 'wp_all_import_plugin');?></a>
|
162 |
<p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
|
163 |
</div>
|
164 |
+
|
165 |
+
<textarea id="wp_all_import_code" name="wp_all_import_code"><?php echo "<?php\n\n?>";?></textarea>
|
166 |
|
167 |
<div class="input" style="margin-top: 10px;">
|
168 |
|
170 |
<input type="button" class="button-primary wp_all_import_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_import_plugin'); ?>"/>
|
171 |
<a href="#help" class="wpallimport-help" title="<?php printf(__("Add functions here for use during your import. You can access this file at %s", "wp_all_import_plugin"), esc_attr(preg_replace("%.*wp-content%", "wp-content", $functions)));?>" style="top: 0;">?</a>
|
172 |
<div class="wp_all_import_functions_preloader"></div>
|
173 |
+
</div>
|
174 |
<div class="input wp_all_import_saving_status" style="display:inline-block;">
|
175 |
|
176 |
</div>
|
180 |
</div>
|
181 |
</div>
|
182 |
</div>
|
183 |
+
</div>
|
184 |
+
|
185 |
<hr>
|
186 |
+
|
187 |
<div class="input wpallimport-section load-template-container" style="padding-bottom: 8px; padding-left: 8px;">
|
188 |
|
189 |
+
<?php
|
190 |
+
wp_all_import_template_notifications( $post, 'notice' );
|
191 |
+
?>
|
192 |
+
|
193 |
<p style="margin: 11px; float: left;">
|
194 |
<input type="hidden" name="save_template_as" value="0" />
|
195 |
+
<input type="checkbox" id="save_template_as" name="save_template_as" class="switcher-horizontal fix_checkbox" value="1" <?php echo ( ! empty($post['save_template_as'])) ? 'checked="checked"' : '' ?> />
|
196 |
<label for="save_template_as"><?php _e('Save settings as a template','wp_all_import_plugin');?></label>
|
197 |
</p>
|
198 |
<div class="switcher-target-save_template_as" style="float: left; overflow: hidden;">
|
199 |
+
<input type="text" name="name" placeholder="<?php _e('Template name...', 'wp_all_import_plugin') ?>" style="vertical-align:middle; line-height: 26px;" value="<?php echo esc_attr($post['name']) ?>" />
|
200 |
+
</div>
|
201 |
<?php $templates = new PMXI_Template_List(); ?>
|
202 |
+
<div class="load-template">
|
203 |
<select name="load_template" id="load_template">
|
204 |
<option value=""><?php _e('Load Template...', 'wp_all_import_plugin') ?></option>
|
205 |
<?php foreach ($templates->getBy()->convertRecords() as $t): ?>
|
206 |
+
<option value="<?php echo $t->id ?>"><?php echo $t->name ?></option>
|
207 |
<?php endforeach ?>
|
208 |
</select>
|
209 |
</div>
|
210 |
+
|
211 |
</div>
|
212 |
|
213 |
<hr>
|
214 |
|
215 |
<div class="wpallimport-submit-buttons">
|
216 |
+
|
217 |
<div style="text-align:center; width:100%;">
|
218 |
|
219 |
<div class="wpallimport-free-edition-notice wpallimport-dynamic-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
|
226 |
|
227 |
<?php wp_nonce_field('template', '_wpnonce_template'); ?>
|
228 |
|
229 |
+
<input type="hidden" name="is_submitted" value="1" />
|
230 |
+
<input type="hidden" name="security" value="<?php echo wp_create_nonce( "wp_all_import_preview" ); ?>" />
|
231 |
|
232 |
<?php if ($this->isWizard):?>
|
233 |
+
<a href="<?php echo esc_url(add_query_arg('action', 'element', $this->baseUrl)) ?>" class="back rad3" style="float:none;"><?php _e('Back to Step 2', 'wp_all_import_plugin') ?></a>
|
234 |
<?php else: ?>
|
235 |
<a href="<?php echo esc_url(remove_query_arg('id', remove_query_arg('action', $this->baseUrl))); ?>" class="back rad3" style="float:none;"><?php _e('Back to Manage Imports', 'wp_all_import_plugin') ?></a>
|
236 |
+
<?php endif; ?>
|
237 |
<input type="submit" class="button button-primary button-hero wpallimport-large-button" value="<?php _e( ($this->isWizard) ? 'Continue to Step 4' : 'Update Template', 'wp_all_import_plugin') ?>" />
|
238 |
</div>
|
239 |
|
240 |
</div>
|
241 |
|
242 |
<a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
|
243 |
+
|
244 |
</td>
|
245 |
<?php if ($this->isWizard or $this->isTemplateEdit): ?>
|
246 |
<td class="right template-sidebar">
|
250 |
</td>
|
251 |
<?php endif ?>
|
252 |
</tr>
|
253 |
+
</table>
|
254 |
|
255 |
</form>
|
views/admin/manage/index.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<div class="wpallimport-logo"></div>
|
5 |
<div class="wpallimport-title">
|
6 |
<h3><?php _e('Manage Imports', 'wp_all_import_plugin'); ?></h3>
|
7 |
-
</div>
|
8 |
</div>
|
9 |
|
10 |
<?php if ($this->errors->get_error_codes()): ?>
|
@@ -25,9 +25,9 @@
|
|
25 |
$columns = array(
|
26 |
'id' => __('ID', 'wp_all_import_plugin'),
|
27 |
'name' => __('File', 'wp_all_import_plugin'),
|
28 |
-
'actions' => '',
|
29 |
'summary' => __('Summary', 'wp_all_import_plugin'),
|
30 |
-
'info' => __('Info & Options', 'wp_all_import_plugin'),
|
31 |
);
|
32 |
|
33 |
$columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
@@ -145,10 +145,10 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
145 |
<td>
|
146 |
<strong><?php echo esc_attr(apply_filters("pmxi_import_name", (!empty($item['friendly_name'])) ? $item['friendly_name'] : $item['name'], $item['id'])); ?></strong><br>
|
147 |
|
148 |
-
<?php if ($item['path']): ?>
|
149 |
<?php if ( in_array($item['type'], array('upload'))): ?>
|
150 |
<?php $item['path'] = wp_all_import_get_absolute_path($item['path']); ?>
|
151 |
-
<?php
|
152 |
$path = $item['path'];
|
153 |
$path_parts = pathinfo($item['path']);
|
154 |
if ( ! empty($path_parts['dirname'])){
|
@@ -172,22 +172,22 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
172 |
<?php
|
173 |
$import_actions = array(
|
174 |
'import_template' => array(
|
175 |
-
'url' => ( ! $item['processing'] and ! $item['executing'] ) ? add_query_arg(array('id' => $item['id'], 'action' => 'edit'), $this->baseUrl) : '',
|
176 |
-
'title' => __('Edit
|
177 |
'class' => 'edit'
|
178 |
),
|
179 |
-
'import_settings' => array(
|
180 |
-
'url' => ( ! $item['processing'] and ! $item['executing'] ) ? add_query_arg(array('id' => $item['id'], 'action' => 'options'), $this->baseUrl) : '',
|
181 |
-
'title' => __('
|
182 |
'class' => 'edit'
|
183 |
-
),
|
184 |
-
'delete' => array(
|
185 |
-
'url' => add_query_arg(array('id' => $item['id'], 'action' => 'delete'), $this->baseUrl),
|
186 |
-
'title' => __('Delete', 'wp_all_import_plugin'),
|
187 |
'class' => 'delete'
|
188 |
-
),
|
189 |
);
|
190 |
-
|
191 |
$import_actions = apply_filters('pmxi_import_actions', $import_actions, $item );
|
192 |
|
193 |
$ai = 1;
|
@@ -204,10 +204,10 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
204 |
</span> <?php if ($ai != count($import_actions)): ?>|<?php endif; ?>
|
205 |
<?php
|
206 |
break;
|
207 |
-
}
|
208 |
-
$ai++;
|
209 |
}
|
210 |
-
?>
|
211 |
|
212 |
</div>
|
213 |
</td>
|
@@ -216,7 +216,7 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
216 |
case 'summary':
|
217 |
?>
|
218 |
<td>
|
219 |
-
<?php
|
220 |
if ($item['triggered'] and ! $item['processing']){
|
221 |
_e('triggered with cron', 'wp_all_import_plugin');
|
222 |
if ($item['last_activity'] != '0000-00-00 00:00:00'){
|
@@ -285,7 +285,7 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
285 |
if ($item['settings_update_on'] != '0000-00-00 00:00:00' and $item['last_activity'] != '0000-00-00 00:00:00' and strtotime($item['settings_update_on']) > strtotime($item['last_activity'])){
|
286 |
echo '<br/>';
|
287 |
?>
|
288 |
-
<strong><?php _e('settings edited since last run', 'wp_all_import_plugin'); ?></strong>
|
289 |
<?php
|
290 |
}
|
291 |
|
@@ -295,10 +295,10 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
295 |
break;
|
296 |
case 'info':
|
297 |
?>
|
298 |
-
<td>
|
299 |
<a href="#" class="scheduling-disabled"><?php _e('Scheduling Options', 'wp_all_import_plugin'); ?></a>
|
300 |
<a href="#help" class="wpallimport-help" style="position: relative; top: -2px; margin-left: 0;" title="<?php _e("To run this import on a schedule you must use the 'Download from URL' or 'Use existing file' option on the Import Settings page.", PMXI_Plugin::LANGUAGE_DOMAIN);?>">?</a>
|
301 |
-
<br/>
|
302 |
<a href="<?php echo esc_url(add_query_arg(array('page' => 'pmxi-admin-history', 'id' => $item['id']), remove_query_arg('pagenum', $this->baseUrl))); ?>"><?php _e('History Logs', 'wp_all_import_plugin'); ?></a>
|
303 |
</td>
|
304 |
<?php
|
@@ -315,7 +315,7 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
315 |
<?php endif; ?>
|
316 |
</td>
|
317 |
<?php
|
318 |
-
break;
|
319 |
default:
|
320 |
?>
|
321 |
<td>
|
@@ -326,7 +326,7 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
326 |
endswitch;
|
327 |
?>
|
328 |
<?php endforeach; ?>
|
329 |
-
</tr>
|
330 |
<?php do_action('pmxi_manage_imports', $item, $class); ?>
|
331 |
<?php endforeach; ?>
|
332 |
<?php endif ?>
|
@@ -364,8 +364,8 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
|
364 |
}
|
365 |
?>
|
366 |
|
367 |
-
<p style='font-size: 1.3em; font-weight: bold;'><a href="http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=upgrade-to-pro" target="_blank" class="upgrade_link"><?php _e('Find out more about the Pro edition of WP All Import.', 'wp_all_import_plugin'); ?></a></p>
|
368 |
-
|
369 |
<a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
|
370 |
|
371 |
</form>
|
4 |
<div class="wpallimport-logo"></div>
|
5 |
<div class="wpallimport-title">
|
6 |
<h3><?php _e('Manage Imports', 'wp_all_import_plugin'); ?></h3>
|
7 |
+
</div>
|
8 |
</div>
|
9 |
|
10 |
<?php if ($this->errors->get_error_codes()): ?>
|
25 |
$columns = array(
|
26 |
'id' => __('ID', 'wp_all_import_plugin'),
|
27 |
'name' => __('File', 'wp_all_import_plugin'),
|
28 |
+
'actions' => '',
|
29 |
'summary' => __('Summary', 'wp_all_import_plugin'),
|
30 |
+
'info' => __('Info & Options', 'wp_all_import_plugin'),
|
31 |
);
|
32 |
|
33 |
$columns = apply_filters('pmxi_manage_imports_columns', $columns);
|
145 |
<td>
|
146 |
<strong><?php echo esc_attr(apply_filters("pmxi_import_name", (!empty($item['friendly_name'])) ? $item['friendly_name'] : $item['name'], $item['id'])); ?></strong><br>
|
147 |
|
148 |
+
<?php if ($item['path']): ?>
|
149 |
<?php if ( in_array($item['type'], array('upload'))): ?>
|
150 |
<?php $item['path'] = wp_all_import_get_absolute_path($item['path']); ?>
|
151 |
+
<?php
|
152 |
$path = $item['path'];
|
153 |
$path_parts = pathinfo($item['path']);
|
154 |
if ( ! empty($path_parts['dirname'])){
|
172 |
<?php
|
173 |
$import_actions = array(
|
174 |
'import_template' => array(
|
175 |
+
'url' => ( ! $item['processing'] and ! $item['executing'] ) ? esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'edit'), $this->baseUrl)) : '',
|
176 |
+
'title' => __('Edit Template', 'wp_all_import_plugin'),
|
177 |
'class' => 'edit'
|
178 |
),
|
179 |
+
'import_settings' => array(
|
180 |
+
'url' => ( ! $item['processing'] and ! $item['executing'] ) ? esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'options'), $this->baseUrl)) : '',
|
181 |
+
'title' => __('Settings', 'wp_all_import_plugin'),
|
182 |
'class' => 'edit'
|
183 |
+
),
|
184 |
+
'delete' => array(
|
185 |
+
'url' => esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'delete'), $this->baseUrl)),
|
186 |
+
'title' => __('Delete', 'wp_all_import_plugin'),
|
187 |
'class' => 'delete'
|
188 |
+
),
|
189 |
);
|
190 |
+
|
191 |
$import_actions = apply_filters('pmxi_import_actions', $import_actions, $item );
|
192 |
|
193 |
$ai = 1;
|
204 |
</span> <?php if ($ai != count($import_actions)): ?>|<?php endif; ?>
|
205 |
<?php
|
206 |
break;
|
207 |
+
}
|
208 |
+
$ai++;
|
209 |
}
|
210 |
+
?>
|
211 |
|
212 |
</div>
|
213 |
</td>
|
216 |
case 'summary':
|
217 |
?>
|
218 |
<td>
|
219 |
+
<?php
|
220 |
if ($item['triggered'] and ! $item['processing']){
|
221 |
_e('triggered with cron', 'wp_all_import_plugin');
|
222 |
if ($item['last_activity'] != '0000-00-00 00:00:00'){
|
285 |
if ($item['settings_update_on'] != '0000-00-00 00:00:00' and $item['last_activity'] != '0000-00-00 00:00:00' and strtotime($item['settings_update_on']) > strtotime($item['last_activity'])){
|
286 |
echo '<br/>';
|
287 |
?>
|
288 |
+
<strong><?php _e('settings edited since last run', 'wp_all_import_plugin'); ?></strong>
|
289 |
<?php
|
290 |
}
|
291 |
|
295 |
break;
|
296 |
case 'info':
|
297 |
?>
|
298 |
+
<td>
|
299 |
<a href="#" class="scheduling-disabled"><?php _e('Scheduling Options', 'wp_all_import_plugin'); ?></a>
|
300 |
<a href="#help" class="wpallimport-help" style="position: relative; top: -2px; margin-left: 0;" title="<?php _e("To run this import on a schedule you must use the 'Download from URL' or 'Use existing file' option on the Import Settings page.", PMXI_Plugin::LANGUAGE_DOMAIN);?>">?</a>
|
301 |
+
<br/>
|
302 |
<a href="<?php echo esc_url(add_query_arg(array('page' => 'pmxi-admin-history', 'id' => $item['id']), remove_query_arg('pagenum', $this->baseUrl))); ?>"><?php _e('History Logs', 'wp_all_import_plugin'); ?></a>
|
303 |
</td>
|
304 |
<?php
|
315 |
<?php endif; ?>
|
316 |
</td>
|
317 |
<?php
|
318 |
+
break;
|
319 |
default:
|
320 |
?>
|
321 |
<td>
|
326 |
endswitch;
|
327 |
?>
|
328 |
<?php endforeach; ?>
|
329 |
+
</tr>
|
330 |
<?php do_action('pmxi_manage_imports', $item, $class); ?>
|
331 |
<?php endforeach; ?>
|
332 |
<?php endif ?>
|
364 |
}
|
365 |
?>
|
366 |
|
367 |
+
<p style='font-size: 1.3em; font-weight: bold;'><a href="http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=upgrade-to-pro" target="_blank" class="upgrade_link"><?php _e('Find out more about the Pro edition of WP All Import.', 'wp_all_import_plugin'); ?></a></p>
|
368 |
+
|
369 |
<a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
|
370 |
|
371 |
</form>
|