Telemetry::filter_optin_args( TECCommonTelemetryarray $args, TECCommonTelemetry?string $slug = null )

Filters the default optin modal args.


Parameters

$args

(<span class="TECCommonTelemetryarrayTECCommonTelemetryarray<string|">TECCommonTelemetrymixed>) (Required) The current optin modal args.

$slug

(TECCommonTelemetry?string) (Optional) The Stellar slug being used for Telemetry.

Default value: null


Top ↑

Return

(TECCommonTelemetryarray<string|TECCommonTelemetrymixed>)


Top ↑

Source

File: src/Common/Telemetry/Telemetry.php

	public function filter_optin_args( $args ): array {
		$user_name   = esc_html( wp_get_current_user()->display_name );

		/*
		if ET only change logo, name to Event Tickets
		if TEC only change logo
		If both, use The Events Calendar
		*/

		$optin_args = [
			'plugin_logo'           => tribe_resource_url( 'images/logo/tec-brand.svg', false, null, \Tribe__Main::instance() ),
			'plugin_logo_width'     => 'auto',
			'plugin_logo_height'    => 42,
			'plugin_logo_alt'       => 'TEC Common Logo',
			'plugin_name'           => 'TEC Common',
			'plugin_slug'           => self::get_plugin_slug(),
			'user_name'             => $user_name,
			'permissions_url'       => self::get_permissions_url(),
			'tos_url'               => self::get_terms_url(),
			'privacy_url'           => self::get_privacy_url(),
			'opted_in_plugins_text' => __( 'See which plugins you have opted in to tracking for', 'tribe-common' ),
			'heading'               => __( 'We hope you love TEC Common!', 'tribe-common' ),
			'intro'                 => __( "Hi, {$user_name}! This is an invitation to help our StellarWP community. If you opt-in, some data about your usage of TEC Common and future StellarWP Products will be shared with our teams (so they can work their butts off to improve). We will also share some helpful info on WordPress, and our products from time to time. And if you skip this, that’s okay! Our products still work just fine.", 'tribe-common' ),
		];

		/**
		 * Allows overriding the modal optin args.
		 *
		 * @since 5.1.0
		 *
		 * @param array<string,mixed> $optin_args The modal arguments to filter.
		 */
		$this->optin_args = apply_filters( 'tec_common_telemetry_optin_args', $optin_args );

		return array_merge( $args, $this->optin_args );
	}

Top ↑

Changelog

Changelog
Version Description
5.1.0 Introduced.