Abstract_Dashboard::add_fields( TECEvent_AutomatorIntegrationsAdminarray $fields = array() )

Get the integration endpoint dashboard fields to display on the Integrations tab.


Parameters

$fields

(<span class="TECEvent_AutomatorIntegrationsAdminarray">TECEvent_AutomatorIntegrationsAdminarray) (Optional) The current fields.

Default value: array()


Top ↑

Return

(TECEvent_AutomatorIntegrationsAdminarray<string,array>) The fields, as updated by the settings.


Top ↑

Source

File: src/Common/Event_Automator/Integrations/Admin/Abstract_Dashboard.php

	public function add_fields( array $fields = [] ) {
		$api_id = static::$api_id;

		$wrapper_classes = tribe_get_classes( [
			'tec-automator-dashboard'                       => true,
			'tec-events-settings-' . $api_id . '-dashboard' => true,
		] );

		$dashboard_fields = [
			static::$option_prefix . 'wrapper_open'  => [
				'type' => 'html',
				'html' => '<div id="tribe-settings-' . $api_id . '-application" class="' . implode( ' ', $wrapper_classes ) . '">'
			],
			static::$option_prefix . 'header'        => [
				'type' => 'html',
				'html' => $this->get_intro_text(),
			],
			static::$option_prefix . 'endpoints'     => [
				'type' => 'html',
				'html' => $this->get_dashboard(),
			],
			static::$option_prefix . 'wrapper_close' => [
				'type' => 'html',
				'html' => '<div class="clear"></div></div>',
			],
		];

		$fields = array_merge( $fields, $dashboard_fields );

		/**
		 * Filters the integration endpoint dashboard shown to the user in the Events > Settings > Integrations tab.
		 *
		 * @since 1.4.0
		 *
		 * @param array<string,array> $fields A map of the API fields that will be printed on the page.
		 * @param Dashboard           $this   A Dashboard instance.
		 */
		$fields = apply_filters( "tec_event_automator_{$api_id}_dashboard_fields", $fields, $this );

		return $fields;
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.