I migrated a Drupal site to WordPress and some of the imported custom post types originally had a date field that can either have a simple date or a start date and an end date. What I have now in my import is a date filed that has two entries. Is there a way to ignore the second date if it is identical with the first and/or define the first date as a start date and the second as an end date?
Thanks in advance,
Jannis
Is there a way to ignore the second date if it is identical with the first and/or define the first date as a start date and the second as an end date?
Hi, unfortunately there's nothing built in to Toolset that will help split repeating field values into other single field values. Are you using a CSV file to import your content? If so, then you can create two new custom date fields in Types - one for start date and another for end date. Then edit the CSV file manually before import. Copy all the old date values to use as the new start date field values. Then find any new start date fields with multiple date values. Cut the second date value and paste it in the new end date field value. During your import process, do not map the old date field to anything in Toolset. Instead, map the new start and end date fields. It's a tedious process, but it could be accomplished without any custom code.
Or if you're comfortable writing code, a custom SQL database script could loop over all the posts that have this date field, and transpose the existing field values into the new start and end date fields. I can show you how to access any custom field in the database, but the SQL code itself is outside the scope of support we provide here.