Abstract_Export::modify_video_source_export_output( array $fields, WP_Post $event, string $key_name, string $type, boolean $should_show )

Modify the export parameters for an API source.


Parameters

$fields

(array) (Required) The various file format components for this specific event.

$event

(WP_Post) (Required) The WP_Post of this event.

$key_name

(string) (Required) The name of the array key to modify.

$type

(string) (Required) The name of the export type.

$should_show

(boolean) (Required) Whether to modify the export fields for the current user, default to false.


Top ↑

Return

(array) The various file format components for this specific event.


Top ↑

Source

File: src/Tribe/Export/Abstract_Export.php

	public function modify_video_source_export_output( $fields, $event, $key_name, $type, $should_show ) {
		$api_id = static::$api_id;

		if ( $api_id !== $event->virtual_video_source ) {
			return $fields;
		}

		// If it should not show or no linked button and details, set the permalink and return.
		if (
			! $should_show ||
			(
				! $event->virtual_linked_button &&
				! $event->virtual_meeting_display_details
			)
		 ) {
			$fields[ $key_name ] = $this->format_value( get_the_permalink( $event->ID ), $key_name, $type );

			return $fields;
		}

		$url = empty( $event->virtual_meeting_url ) ? $event->virtual_url : $event->virtual_meeting_url;

		$fields[ $key_name ] = $this->format_value( $url, $key_name, $type );

		/**
		 * Allow filtering of the export fields for an API.
		 *
		 * @since 1.13.0
		 *
		 * @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.
		 * @param boolean  $should_show Whether to modify the export fields for the current user, default to false.
		 */
		$fields = apply_filters( "tec_events_virtual_{$api_id}_export_fields", $fields, $event, $key_name, $type, $should_show );

		return $fields;
	}

Top ↑

Changelog

Changelog
Version Description
1.13.0 Introduced.