Event_Export::modify_export_output( array $fields, int $event_id, string $key_name, string $type = null )
Modify the export parameters for a virtual event export.
Contents
Parameters
- $fields
-
(array) (Required) The various file format components for this specific event.
- $event_id
-
(int) (Required) The event id.
- $key_name
-
(string) (Required) The name of the array key to modify.
- $type
-
(string) (Optional) The name of the export type.
Default value: null
Return
(array) The various file format components for this specific event.
Source
File: src/Tribe/Export/Event_Export.php
public function modify_export_output( $fields, $event_id, $key_name, $type = null ) {
$event = tribe_get_event( $event_id );
if ( ! $event instanceof \WP_Post ) {
return $fields;
}
// If it is not a virtual event, return fields.
if ( ! $event->virtual ) {
return $fields;
}
// If there is a venue, return fields as is.
if ( isset( $event->venues[0] ) ) {
return $fields;
}
/**
* Allow filtering of the export fields by the active video source.
*
* @since 1.7.3
*
* @param array $fields The various file format components for this specific event.
* @param \WP_Post $event The WP_Post of this event.
* @param string $key_name The name of the array key to modify.
* @param string $type The name of the export type.
*/
$fields = apply_filters( 'tec_events_virtual_export_fields', $fields, $event, $key_name, $type );
return $fields;
}
Changelog
| Version | Description |
|---|---|
| 1.8.0 | - Added a filter to determine if the export fields modified based on the show to setting. |
| 1.7.3 | - Add a filter to allow the active video source to modify the export fields. |
| 1.0.4 | Introduced. |