Version Description
- Bug fix: Fails to update empty custom field value.
Download this release
Release Info
Developer | hissy |
Plugin | Really Simple CSV Importer |
Version | 0.5.6 |
Comparing to | |
See all releases |
Code changes from version 0.5.4 to 0.5.6
- index.php +2 -0
- readme.txt +17 -4
- rs-csv-importer.php +1 -1
- wp_post_helper/class-wp_post_helper.php +11 -3
index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: hissy, wokamoto
|
3 |
Tags: importer, csv, acf
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 0.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -20,7 +20,7 @@ Alternative CSV Importer plugin. Simple and powerful.
|
|
20 |
* Custom Taxonomy support
|
21 |
* Custom Post Type support
|
22 |
|
23 |
-
Contains CSV file
|
24 |
|
25 |
= Available column names and values: =
|
26 |
* `ID` or `post_id`: (int) post id.
|
@@ -40,8 +40,9 @@ Contains CSV file samples in `/wp-content/plugins/really-simple-csv-importer/sam
|
|
40 |
* `post_category`: (string, comma divided) slug of post categories
|
41 |
* `post_tags`: (string, comma divided) name of post tags
|
42 |
* `{custom_field}`: (string) Any other column labels used as custom field
|
43 |
-
* `tax_{taxonomy}`: (string, comma divided) Any field prefixed with tax_ in the "custom_field" area will be used as a custom taxonomy. Taxonomy must already exist. Entries are names
|
44 |
|
|
|
45 |
Note: To set the page template of a page, use custom field key of `_wp_page_template`.
|
46 |
Note: If providing a post_status of 'future' you must specify the post_date in order for WordPress to know when to publish your post.
|
47 |
|
@@ -52,6 +53,9 @@ How to find advanced custom field key: [Finding the field key](http://www.advanc
|
|
52 |
= Official public repository =
|
53 |
Add star and read future issues about rs-csv-importer on [GitHub](https://github.com/hissy/rs-csv-importer)!
|
54 |
|
|
|
|
|
|
|
55 |
== Installation ==
|
56 |
|
57 |
1. Upload All files to the `/wp-content/plugins/` directory.
|
@@ -190,8 +194,17 @@ function really_simple_csv_importer_save_tax_filter( $tax, $post, $is_update ) {
|
|
190 |
add_filter( 'really_simple_csv_importer_save_tax', 'really_simple_csv_importer_save_tax_filter', 10, 3 );
|
191 |
`
|
192 |
|
|
|
|
|
|
|
|
|
|
|
193 |
== Changelog ==
|
194 |
|
|
|
|
|
|
|
|
|
195 |
= 0.5.4 =
|
196 |
* Enhancement: Check the post type is already exists.
|
197 |
* Update readme
|
2 |
Contributors: hissy, wokamoto
|
3 |
Tags: importer, csv, acf
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 3.7.1
|
6 |
+
Stable tag: 0.5.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
20 |
* Custom Taxonomy support
|
21 |
* Custom Post Type support
|
22 |
|
23 |
+
Contains CSV file examples in `/wp-content/plugins/really-simple-csv-importer/sample` directory.
|
24 |
|
25 |
= Available column names and values: =
|
26 |
* `ID` or `post_id`: (int) post id.
|
40 |
* `post_category`: (string, comma divided) slug of post categories
|
41 |
* `post_tags`: (string, comma divided) name of post tags
|
42 |
* `{custom_field}`: (string) Any other column labels used as custom field
|
43 |
+
* `tax_{taxonomy}`: (string, comma divided) Any field prefixed with tax_ in the "custom_field" area will be used as a custom taxonomy. Taxonomy must already exist. Entries are names or slugs of terms.
|
44 |
|
45 |
+
Note: Empty cells in the csv file means "keep it", not "delete it".
|
46 |
Note: To set the page template of a page, use custom field key of `_wp_page_template`.
|
47 |
Note: If providing a post_status of 'future' you must specify the post_date in order for WordPress to know when to publish your post.
|
48 |
|
53 |
= Official public repository =
|
54 |
Add star and read future issues about rs-csv-importer on [GitHub](https://github.com/hissy/rs-csv-importer)!
|
55 |
|
56 |
+
= Thanks =
|
57 |
+
Cover banner designed by @[luchino__](http://uwasora.com/)
|
58 |
+
|
59 |
== Installation ==
|
60 |
|
61 |
1. Upload All files to the `/wp-content/plugins/` directory.
|
194 |
add_filter( 'really_simple_csv_importer_save_tax', 'really_simple_csv_importer_save_tax_filter', 10, 3 );
|
195 |
`
|
196 |
|
197 |
+
== How to debug import post data ==
|
198 |
+
|
199 |
+
*Really Simple CSV Importer Debugger add-on* enables you to show more detailed post, meta, taxonomy data of each csv row.
|
200 |
+
Download from [gist](https://gist.github.com/hissy/7175656).
|
201 |
+
|
202 |
== Changelog ==
|
203 |
|
204 |
+
= 0.5.6 =
|
205 |
+
* Bug fix: Fails to update empty custom field value.
|
206 |
+
= 0.5.5 =
|
207 |
+
* Bug fix: Fix to enable to update post meta values.
|
208 |
= 0.5.4 =
|
209 |
* Enhancement: Check the post type is already exists.
|
210 |
* Update readme
|
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.5.
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
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.5.6
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
wp_post_helper/class-wp_post_helper.php
CHANGED
@@ -294,10 +294,18 @@ class wp_post_helper {
|
|
294 |
|
295 |
// Add Custom Field
|
296 |
public function add_meta($metakey, $val, $unique = true){
|
297 |
-
if (!$this->postid)
|
298 |
$this->metas[$metakey] = array($val, $unique);
|
299 |
-
else
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
}
|
302 |
|
303 |
// Add Advanced Custom Field
|
294 |
|
295 |
// Add Custom Field
|
296 |
public function add_meta($metakey, $val, $unique = true){
|
297 |
+
if (!$this->postid) {
|
298 |
$this->metas[$metakey] = array($val, $unique);
|
299 |
+
} else {
|
300 |
+
if (!empty($val)) {
|
301 |
+
if (get_post_meta($this->postid, $metakey, true) !== false) {
|
302 |
+
return update_post_meta($this->postid, $metakey, $val);
|
303 |
+
} else {
|
304 |
+
return add_post_meta($this->postid, $metakey, $val, $unique);
|
305 |
+
}
|
306 |
+
}
|
307 |
+
return false;
|
308 |
+
}
|
309 |
}
|
310 |
|
311 |
// Add Advanced Custom Field
|