apply_filters( 'tec_events_virtual_export_fields', array $fields , WP_Post $event , string $key_name , string $type , boolean $should_show )
Allow filtering of the export fields by the active video source.
Contents
Parameters
- $fields
-
(array) The various file format components for this specific event.
- $event
-
(WP_Post) The WP_Post of this event.
- $key_name
-
(string) The name of the array key to modify.
- $type
-
(string) The name of the export type.
- $should_show
-
(boolean) Whether to modify the export fields for the current user, default to false.
More Information
This filter allows you to modify the fields that will be included on the export.
add_filter( 'tec_events_virtual_export_fields', 'customize_export_fields', 10, 5 );
function customize_export_fields( $fields, $event, $key_name, $type, $should_show ) {
// Adding a new field
$fields['new_field'] = 'New Field Value';
// Removing a field
unset( $fields['old_field'] );
return $fields;
}
Source
Changelog
| Version | Description |
|---|---|
| 1.8.0 | add should_show parameter. |
| 1.7.3 | Introduced. |