Some CultureHosts records refer to others, e.g. an event can have a venue_id. This task
checks the local database to see if that referred-to record has already been imported and,
if so, stores the resulting local post ID in postmeta, instead of the remote record ID.
Located at culturehosts-importer/src/Service/Tasks/Related_Post_To_Postmeta.php
| Methods |
public
|
__construct(
string|string[] $source_fields,
string $related_post_type,
string $meta_key,
array|Formatter|callable $formatters = [],
)
Set the source field, post type to search for a match, and meta key as the storage destination.
Set the source field, post type to search for a match, and meta key as the storage destination.
Parameters
| $source_fields |
The name of the source record field holding a CultureHosts
record ID.
|
| $related_post_type |
The post type we should search for an imported match
|
| $meta_key |
The desitination where we save the found WP post ID
|
| $formatters |
The formatters to pass the field values through
|
Overrides
|
#
|