Provider::rename_recurring_settings_on_admin( $settings )

Update the wording used for the recurring labels on the general tab of the settings.


Parameters

(<span class="TECEvents_ProCustom_TablesV1Legacy_CompatarrayTECEvents_ProCustom_TablesV1Legacy_Compatarray<string,) (Required) array<string, mixed>> $settings An array with all the settings for that particular tab.

$id

(string) (Required) The name of the tab we are targeting.


Top ↑

Return

(TECEvents_ProCustom_TablesV1Legacy_Compatarray<string,) array<string, mixed>> An array with the updated settings.


Top ↑

Source

File: src/Events_Pro/Custom_Tables/V1/Legacy_Compat/Provider.php

	public function rename_recurring_settings_on_admin( $settings, $id ) {
		// We are targeting the general tab from the admin.
		if ( $id !== 'general' ) {
			return $settings;
		}

		// Make sure $settings is always an array.
		if ( ! is_array( $settings ) ) {
			$settings = [];
		}

		// Keys we are accessing inside the $settings array.
		$keys = [
			'hideSubsequentRecurrencesDefault',
			'userToggleSubsequentRecurrences',
		];

		// Make sure the keys exists as arrays before accessing any of the keys.
		foreach ( $keys as $key ) {
			if ( ! array_key_exists( $key, $settings ) || ! is_array( $settings[ $key ] ) ) {
				$settings[ $key ] = [];
			}
		}

		// hideSubsequentRecurrencesDefault
		$settings['hideSubsequentRecurrencesDefault']['label']   = __( 'Condense events in Series', 'tribe-events-calendar-pro' );
		$settings['hideSubsequentRecurrencesDefault']['tooltip'] = __( 'Show only the next event in each Series (only affects list-style views).',
			'tribe-events-calendar-pro' );
		// userToggleSubsequentRecurrences
		$settings['userToggleSubsequentRecurrences']['label']   = __( 'Front-end Condense Events Series toggle',
			'tribe-events-calendar-pro' );
		$settings['userToggleSubsequentRecurrences']['tooltip'] = __( 'Allow users to limit list-style views to only show the next event in each Series.',
			'tribe-events-calendar-pro' );

		return $settings;
	}