Importing Category with comma
Hi, I have a few categories that have a comma in them, for example: "Commercial, office space". When using the ClassiPress importer, it will treat this as 2 separate categories and the ad will get associated with both "Commercial" and "office space" categories separately. The importer will actually create these 2 new categories since it will not find them.
This seems to be a feature in the importer that allows you to assign multiple categories or tags to an ad by comma separating them in your import file. In my case, since I have categories that use a comma, this is most definitely an issue. So I went digging in the importer files to find where this feature code is kept.
\classipress\framework\admin\importer.php
foreach ( $this->taxonomies as $col ) {
if ( isset( $row[ $col ] ) ) {
$tax_input[ $col ] = array_filter( array_map( 'trim', explode( ',', $row[ $col ] ) ) );
}
}
To resolve my issue, I changed the comma to a semicolon: explode( ';', $row[ $col ] )
Since it's not best practice to modify core files, I am wondering how others have dealt with this issue. I am assuming many other users have categories with commas in them.
I would also like to mention that there seems to be another thread discussing the same import issue on the Vantage forum, but sadly I do not have access to it.
http://forums.appthemes.com/help-usi...-commas-83055/
I am using ClassiPress 3.5.1 (Released on: Sep 1, 2015)
Vic