Hooks::filter_get_stylesheet_option( string $value, string $key )

Filter the stylesheet option to do some switching for V2


Parameters #

$value

(string) (Required) The option value.

$key

(string) (Required) The option key.


Top ↑

Return #

(void)


Top ↑

Source #

File: src/Tribe/Views/V2/Hooks.php

	public function filter_get_stylesheet_option( $value, $key ) {
		// Remove this filter so we don't loop infinitely.
		remove_filter( 'tribe_get_option', [ $this, 'filter_get_stylesheet_option' ], 10, 2 );

		$default = 'tribe';

		if ( 'stylesheet_mode' === $key && empty( $value ) ) {
			$value = tribe_get_option( 'stylesheetOption', $default );
			if ( 'full' === $value ) {
				$value = $default;
			}
		}

		if ( 'stylesheetOption' === $key ) {
			$value = tribe_get_option( 'stylesheet_mode', $default );
		}

		// Add the filter back
		add_filter( 'tribe_get_option', [ $this, 'filter_get_stylesheet_option' ], 10, 2 );

		return $value;
	}

Top ↑

Changelog #

Changelog
Version Description
5.0.2 Introduced.