PluginProbe
Import WP – CSV & XML Import Export for WordPress / 2.15.0
Import WP – CSV & XML Import Export for WordPress v2.15.0
2.15.1 2.15.0 2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 All 144 releases
← All changes | class/Common/Importer/Importer.php +18 -1 2.14.23 → 2.15.0 View file →
@@ -7,11 +7,13 @@
7 7 use ImportWP\Common\Importer\Exception\MapperException;
8 8 use ImportWP\Common\Importer\Exception\ParserException;
9 9 use ImportWP\Common\Importer\Exception\RecordUpdatedSkippedException;
10 10 use ImportWP\Common\Importer\File\CSVFile;
11 +use ImportWP\Common\Importer\File\JSONFile;
11 12 use ImportWP\Common\Importer\File\XMLFile;
12 13 use ImportWP\Common\Importer\MapperInterface;
13 14 use ImportWP\Common\Importer\Parser\CSVParser;
15 +use ImportWP\Common\Importer\Parser\JSONParser;
14 16 use ImportWP\Common\Importer\Parser\XMLParser;
15 17 use ImportWP\Common\Importer\ParserInterface;
16 18 use ImportWP\Common\Importer\State\ImporterState;
17 19 use ImportWP\Common\Properties\Properties;
@@ -131,8 +133,23 @@
131 133 return $this;
132 134 }
133 135
134 136 /**
137 + * Load JSON File
138 + *
139 + * @param string $file_path
140 + *
141 + * @return $this
142 + */
143 + public function jsonFile($file_path)
144 + {
145 + $file = new JSONFile($file_path, $this->config);
146 + $this->parser = new JSONParser($file);
147 +
148 + return $this;
149 + }
150 +
151 + /**
135 152 * Set record to start importing from
136 153 *
137 154 * @param int $start
138 155 */
@@ -532,9 +549,9 @@
532 549 if (!empty($unqiue_identifier_settings) && isset($unqiue_identifier_settings['field'], $unqiue_identifier_settings['value'])) {
533 550
534 551 $unique_identifier_str = ' using unique identifier ';
535 552 if ($unqiue_identifier_settings['field'] === '_iwp_ref_uid') {
536 - $unique_identifier_str .= sprintf('("%s")', $unqiue_identifier_settings['value']);
553 + $unique_identifier_str .= sprintf('("_iwp_ref_uid" = "%s")', $unqiue_identifier_settings['value']);
537 554 } else {
538 555 $unique_identifier_str .= sprintf('("%s" = "%s")', $unqiue_identifier_settings['field'], $unqiue_identifier_settings['value']);
539 556 }
540 557 }