Version Description
- Fix error on PHP 5.2
Download this release
Release Info
Developer | hissy |
Plugin | Really Simple CSV Importer |
Version | 0.6.2 |
Comparing to | |
See all releases |
Code changes from version 0.5.5 to 0.6.2
- readme.txt +8 -4
- rs-csv-importer.php +5 -4
- wp_post_helper/class-wp_post_helper.php +1 -1
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Really Simple CSV Importer ===
|
2 |
Contributors: hissy, wokamoto
|
3 |
-
Tags: importer, csv, acf
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.9.1
|
6 |
-
Stable tag: 0.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -16,8 +16,8 @@ Alternative CSV Importer plugin. Simple and powerful, best for geeks.
|
|
16 |
* Category support
|
17 |
* Tag support
|
18 |
* Custom field support
|
19 |
-
* Custom Field Suite support
|
20 |
-
* Advanced Custom Fields support
|
21 |
* Custom Taxonomy support
|
22 |
* Custom Post Type support
|
23 |
* Many useful filter hooks
|
@@ -210,6 +210,10 @@ Example: [gist](https://gist.github.com/hissy/1ea54a46fd07be9f4334)
|
|
210 |
|
211 |
== Changelog ==
|
212 |
|
|
|
|
|
|
|
|
|
213 |
= 0.6 =
|
214 |
* Enhancement: Custom Field Suite support
|
215 |
* Enhancement: Add ability to override save_post method
|
1 |
=== Really Simple CSV Importer ===
|
2 |
Contributors: hissy, wokamoto
|
3 |
+
Tags: importer, csv, acf, cfs
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.9.1
|
6 |
+
Stable tag: 0.6.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
16 |
* Category support
|
17 |
* Tag support
|
18 |
* Custom field support
|
19 |
+
* [Custom Field Suite](http://customfieldsuite.com/) support
|
20 |
+
* [Advanced Custom Fields](http://www.advancedcustomfields.com/) support
|
21 |
* Custom Taxonomy support
|
22 |
* Custom Post Type support
|
23 |
* Many useful filter hooks
|
210 |
|
211 |
== Changelog ==
|
212 |
|
213 |
+
= 0.6.2 =
|
214 |
+
* Fix error on PHP 5.2
|
215 |
+
= 0.6.1 =
|
216 |
+
* Bug fix: enables to import "0" value
|
217 |
= 0.6 =
|
218 |
* Enhancement: Custom Field Suite support
|
219 |
* Enhancement: Add ability to override save_post method
|
rs-csv-importer.php
CHANGED
@@ -7,7 +7,7 @@ Author: Takuro Hishikawa, wokamoto
|
|
7 |
Author URI: https://en.digitalcube.jp/
|
8 |
Text Domain: rs-csv-importer
|
9 |
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
-
Version: 0.6
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
@@ -105,7 +105,7 @@ class RS_CSV_Importer extends WP_Importer {
|
|
105 |
* @param bool $is_update
|
106 |
* @return int|false Saved post id. If failed, return false.
|
107 |
*/
|
108 |
-
public
|
109 |
$ph = new wp_post_helper($post);
|
110 |
|
111 |
foreach ($meta as $key => $value) {
|
@@ -347,9 +347,10 @@ class RS_CSV_Importer extends WP_Importer {
|
|
347 |
|
348 |
// save post data
|
349 |
if ($class && class_exists($class,false)) {
|
350 |
-
$
|
|
|
351 |
} else {
|
352 |
-
$result =
|
353 |
}
|
354 |
|
355 |
if ($result) {
|
7 |
Author URI: https://en.digitalcube.jp/
|
8 |
Text Domain: rs-csv-importer
|
9 |
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
+
Version: 0.6.2
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
105 |
* @param bool $is_update
|
106 |
* @return int|false Saved post id. If failed, return false.
|
107 |
*/
|
108 |
+
public function save_post($post,$meta,$terms,$thumbnail,$is_update) {
|
109 |
$ph = new wp_post_helper($post);
|
110 |
|
111 |
foreach ($meta as $key => $value) {
|
347 |
|
348 |
// save post data
|
349 |
if ($class && class_exists($class,false)) {
|
350 |
+
$importer = new $class;
|
351 |
+
$result = $importer->save_post($post,$meta,$tax,$post_thumbnail,$is_update);
|
352 |
} else {
|
353 |
+
$result = $this->save_post($post,$meta,$tax,$post_thumbnail,$is_update);
|
354 |
}
|
355 |
|
356 |
if ($result) {
|
wp_post_helper/class-wp_post_helper.php
CHANGED
@@ -292,7 +292,7 @@ class wp_post_helper {
|
|
292 |
if (!$this->postid) {
|
293 |
$this->metas[$metakey] = array($val, $unique);
|
294 |
} else {
|
295 |
-
if (
|
296 |
if (get_post_meta($this->postid, $metakey, true) !== false) {
|
297 |
return update_post_meta($this->postid, $metakey, $val);
|
298 |
} else {
|
292 |
if (!$this->postid) {
|
293 |
$this->metas[$metakey] = array($val, $unique);
|
294 |
} else {
|
295 |
+
if (isset($val) && $val !== false) {
|
296 |
if (get_post_meta($this->postid, $metakey, true) !== false) {
|
297 |
return update_post_meta($this->postid, $metakey, $val);
|
298 |
} else {
|