Customizer::filter_text_color_css( string $template )

Handle text color customizations for Pro.


Parameters

$template

(string) (Required) The original CSS template.


Top ↑

Return

(string) $template The resulting CSS template.


Top ↑

Source

File: src/Tribe/Service_Providers/Customizer.php

	public function filter_text_color_css( $template ) {
		$customizer   = Tribe__Customizer::instance();
		$text_section = tribe( 'tec.customizer.text' );
		$settings     = $customizer->get_option( [ $text_section->ID ] );

		if ( $customizer->has_option( $text_section->ID, 'primary_text_color' ) ) {
			$primary_text_color     = new Tribe__Utils__Color( $settings['primary_text_color'] );
			$primary_text_color_rgb = $primary_text_color::hexToRgb( $settings['primary_text_color'] );
			$primary_rgb            = $primary_text_color_rgb['R'] . ',' . $primary_text_color_rgb['G'] . ',' . $primary_text_color_rgb['B'];

			// PRO Styles.
			$template .= '
				.tribe-events-pro .tribe-events-pro-week-grid__events-time-tag,
				.tribe-events-pro .tribe-events-pro-week-grid__event-tooltip-datetime,
				.tribe-events-pro .tribe-events-pro-week-grid__header-column--current .tribe-events-pro-week-grid__header-column-weekday {
					color: <%= text.primary_text_color %>;
				}
			';

			$template .= '
				.tribe-events-pro.tribe-events-view--week .datepicker .day.disabled {
					color: <%= text.primary_text_color %>;
				}
			';

			$template .= '
				.tribe-events-pro.tribe-events-view--week .datepicker .day.past {
					color: rgba( ' . $primary_rgb . ', 0.62 );
				}
			';
		}

		if ( $customizer->has_option( $text_section->ID, 'secondary_text_color' ) ) {
			// PRO Styles.
			$template .= '
				.tribe-events .tribe-events-calendar-month__calendar-event-datetime,
				.tribe-events-pro .tribe-events-pro-photo__event-date-tag-month,
				.tribe-events-pro .tribe-events-pro-week-grid__event-datetime,
				.tribe-events-pro .tribe-events-pro-map__event-date-tag-month,
				.tribe-common--breakpoint-medium.tribe-events-pro .tribe-events-pro-map__event-distance {
					color: <%= text.secondary_text_color %>;
				}
			';
		}

		return $template;
	}

Top ↑

Changelog

Changelog
Version Description
5.0.1 Introduced.