Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hissy committed Dec 14, 2014
1 parent 2a78d33 commit fbdaf04
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion class-rs_csv_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function parse_columns(&$obj, $array) {

$bom = pack("CCC", 0xef, 0xbb, 0xbf);
if (0 == strncmp($array[0], $bom, 3)) {
$array[0] = substr($array[0], 3);
$array[0] = substr($array[0], 3);
}

$keys = array_keys($array);
Expand Down
40 changes: 20 additions & 20 deletions rs-csv-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,26 @@ function import() {
* @return RSCSV_Import_Post_Helper
*/
public function save_post($post,$meta,$terms,$thumbnail,$is_update) {
// Separate the post tags from $post array
if (isset($post['post_tags']) && !empty($post['post_tags'])) {
$post_tags = $post['post_tags'];
unset($post['post_tags']);
}
// Add or update the post
if ($is_update) {
$h = RSCSV_Import_Post_Helper::getByID($post['ID']);
$h->update($post);
} else {
$h = RSCSV_Import_Post_Helper::add($post);
}
// Set post tags
$h->setPostTags($post_tags);
// Set meta data
$h->setMeta($meta);
// Separate the post tags from $post array
if (isset($post['post_tags']) && !empty($post['post_tags'])) {
$post_tags = $post['post_tags'];
unset($post['post_tags']);
}
// Add or update the post
if ($is_update) {
$h = RSCSV_Import_Post_Helper::getByID($post['ID']);
$h->update($post);
} else {
$h = RSCSV_Import_Post_Helper::add($post);
}
// Set post tags
$h->setPostTags($post_tags);
// Set meta data
$h->setMeta($meta);

// Set terms
foreach ($terms as $key => $value) {
Expand Down

0 comments on commit fbdaf04

Please sign in to comment.