5. OTIS Fields and WP Taxonomies (specifically for TravelOregon.com) - thinkshout/wp-otis GitHub Wiki
The WP-OTIS plugin maps data attributes from OTIS into WP custom taxonomy terms. Most of these are name-based, tag-style taxonomies whose terms have no "memory" of their source within OTIS. The Types taxonomy is different, however.
OTIS Taxonomies
Most attributes for any given listing from OTIS are pulled and stored as different data types (text, boolean, or referential data) via custom fields. However, the following fields are instead stored as taxonomy data:
- Amenities
- AVA
- Bike-Friendly Business Amenities
- EV Types
- OTIS Categories
- Prices
- Retail Categories
- Ride Difficulties
- Seasons
- Tags
- Visitor Center Amenities
- Wilderness Types
Each of the above is considered more tag-like than category-like, so there is no hierarchy for the data. In addition, some similar OTIS attributes are mapped into the same taxonomy together by WP-OTIS--for instance, Resort Amenities and RV Park Amenities are all grouped into Amenities.
These data do not maintain a link to their origin paths on the API. This means that new options added to an existing attribute in OTIS are automatically imported and applied within WP-OTIS. For instance, if an OTIS editor adds a new Retail Category called "foo" and adds it to a couple of listings, then the next time those listing are imported, "foo" will appear within Wordpress in the checkbox list. If a Wordpress editor changes the name of the term "foo" to "bar," that term will persist within the Wordpress system... but the next time an import runs, all the listings that had "foo" before will get it applied again, as well.
By the same token, this means that taxonomy terms added within Wordpress do not get erased by the sync process. If a DMO wanted to add a term to Amenities to indicate that it was near a stop for the local transit system, and manage that entirely within Wordpress, they would see that option within the WP-OTIS Amenities field no matter what kind of OTIS data was imported.
Types
In addition to the above taxonomies, there is one persistent Wordpress "super-taxonomy" called Type, which stores not only the Listing Type data for a listing, but also incorporates the following attributes:
- Activities
- Cycling Ride Type
- Event Type
- Additional Lodging Type
This taxonomy is treated differently than others within WP-OTIS. It has a hierarchical structure--allowing a Wordpress editor to, eg, make "Covered Bridges" a child type of "Culture & History"--and each term references its origin path within OTIS. Within Wordpress, going to /wp/wp-admin/edit-tags.php?taxonomy=type will show you a table of all Types, and under the "OTIS Path" heading, you can see a link to the OTIS API web interface where it originated. This linkage means that if a content editor wanted to change the name of "Covered Bridges" to "Bridges (Covered)" within Wordpress, that change would persist, and updates to listings that are given the type of Covered Bridges within OTIS would be reflected as changes to Bridges (Covered) in Wordpress. The parent-child relationship of terms in Wordpress can also be edited without causing disruption to imports.
New OTIS Taxonomies
An entirely new attribute, rather than a new option in an existing attribute, that is added to OTIS will not be automatically imported. It takes a small amount of developer time to add the new field and a new taxonomy if necessary, but also means pushing out a new release of the plugin to take advantage of it.
Other Wordpress Taxonomies
WP-OTIS post types are fully supported Wordpress post types. They can be organized with other custom taxonomies, which will not be affected by updates to OTIS data. They can also be extended by independent ACF field groups, as long as they are created and maintained separately from the main "OTIS Fields" group.