static function filterDefaults( $defaults ) {

		// SASS => WP
		$overrides = [
			'examples-header-color' => 'edu_textbox_examples_header_color',
			'examples-header-background' => 'edu_textbox_examples_header_background',
			'examples-background' => 'edu_textbox_examples_background',
			'exercises-header-color' => 'edu_textbox_exercises_header_color',
			'exercises-header-background' => 'edu_textbox_exercises_header_background',
			'exercises-background' => 'edu_textbox_exercises_background',
			'learning-objectives-header-color' => 'edu_textbox_objectives_header_color',
			'learning-objectives-header-background' => 'edu_textbox_objectives_header_background',
			'learning-objectives-background' => 'edu_textbox_objectives_background',
			'key-takeaways-header-color' => 'edu_textbox_takeaways_header_color',
			'key-takeaways-header-background' => 'edu_textbox_takeaways_header_background',
			'key-takeaways-background' => 'edu_textbox_takeaways_background',
		];

		$transient_name = 'pressbooks_theme_options_global_parsed_sass_variables';
		$parsed_sass_variables = get_transient( $transient_name );
		if ( $parsed_sass_variables === false ) {
			// Order of files matter. If a variable is duplicated in other files then the last one takes precedence
			$parsed_sass_variables = [];
			$sass = Container::get( 'Sass' );
			$path_to_global = $sass->pathToGlobals();
			$path_to_theme = get_stylesheet_directory();
			$files = [
				$path_to_global . '/variables/_specials.scss',
				$path_to_theme . '/assets/styles/components/_specials.scss',
			];
			foreach ( $files as $file ) {
				if ( file_exists( $file ) ) {
					$parsed_sass_variables[] = $sass->parseVariables( \Pressbooks\Utility\get_contents( $file ) );
				}
			}
			set_transient( $transient_name, $parsed_sass_variables );
		}

		foreach ( $parsed_sass_variables as $parsed_variables ) {
			foreach ( $overrides as $sass_var => $wp_option ) {
				if ( isset( $parsed_variables[ $sass_var ] ) ) {
					if ( ! empty( $parsed_variables[ $sass_var ] ) ) {
						$defaults[ $wp_option ] = $parsed_variables[ $sass_var ]; // Override default with new value
					}
				}
			}
		}

		return $defaults;
	}
static function filterDefaults( $defaults ) {

		// SASS => WP
		$overrides = [
			'examples-header-color' => 'edu_textbox_examples_header_color',
			'examples-header-background' => 'edu_textbox_examples_header_background',
			'examples-background' => 'edu_textbox_examples_background',
			'exercises-header-color' => 'edu_textbox_exercises_header_color',
			'exercises-header-background' => 'edu_textbox_exercises_header_background',
			'exercises-background' => 'edu_textbox_exercises_background',
			'learning-objectives-header-color' => 'edu_textbox_objectives_header_color',
			'learning-objectives-header-background' => 'edu_textbox_objectives_header_background',
			'learning-objectives-background' => 'edu_textbox_objectives_background',
			'key-takeaways-header-color' => 'edu_textbox_takeaways_header_color',
			'key-takeaways-header-background' => 'edu_textbox_takeaways_header_background',
			'key-takeaways-background' => 'edu_textbox_takeaways_background',
		];

		$transient_name = 'pressbooks_theme_options_global_parsed_sass_variables';
		$parsed_sass_variables = get_transient( $transient_name );
		if ( $parsed_sass_variables === false ) {
			// Order of files matter. If a variable is duplicated in other files then the last one takes precedence
			$parsed_sass_variables = [];
			$sass = Container::get( 'Sass' );
			$path_to_global = $sass->pathToGlobals();
			$path_to_theme = get_stylesheet_directory();
			$files = [
				$path_to_global . '/variables/_specials.scss',
				$path_to_theme . '/assets/styles/components/_specials.scss',
			];
			foreach ( $files as $file ) {
				if ( file_exists( $file ) ) {
					$parsed_sass_variables[] = $sass->parseVariables( \Pressbooks\Utility\get_contents( $file ) );
				}
			}
			set_transient( $transient_name, $parsed_sass_variables );
		}

		foreach ( $parsed_sass_variables as $parsed_variables ) {
			foreach ( $overrides as $sass_var => $wp_option ) {
				if ( isset( $parsed_variables[ $sass_var ] ) ) {
					if ( ! empty( $parsed_variables[ $sass_var ] ) ) {
						$defaults[ $wp_option ] = $parsed_variables[ $sass_var ]; // Override default with new value
					}
				}
			}
		}

		return $defaults;
	}
static function filterDefaults ( $ defaults ) { // SASS => WP $ overrides = [ 'examples-header-color' => 'edu_textbox_examples_header_color' , 'examples-header-background' => 'edu_textbox_examples_header_background' , 'examples-background' => 'edu_textbox_examples_background' , 'exercises-header-color' => 'edu_textbox_exercises_header_color' , 'exercises-header-background' => 'edu_textbox_exercises_header_background' , 'exercises-background' => 'edu_textbox_exercises_background' , 'learning-objectives-header-color' => 'edu_textbox_objectives_header_color' , 'learning-objectives-header-background' => 'edu_textbox_objectives_header_background' , 'learning-objectives-background' => 'edu_textbox_objectives_background' , 'key-takeaways-header-color' => 'edu_textbox_takeaways_header_color' , 'key-takeaways-header-background' => 'edu_textbox_takeaways_header_background' , 'key-takeaways-background' => 'edu_textbox_takeaways_background' , ] ; $ transient_name = 'pressbooks_theme_options_global_parsed_sass_variables' ; $ parsed_sass_variables = get_transient ( $ transient_name ) ; if ( $ parsed_sass_variables === false ) { // Order of files matter. If a variable is duplicated in other files then the last one takes precedence $ parsed_sass_variables = [ ] ; $ sass = Container :: get ( 'Sass' ) ; $ path_to_global = $ sass -> pathToGlobals ( ) ; $ path_to_theme = get_stylesheet_directory ( ) ; $ files = [ $ path_to_global . '/variables/_specials.scss' , $ path_to_theme . '/assets/styles/components/_specials.scss' , ] ; foreach ( $ files as $ file ) { if ( file_exists ( $ file ) ) { $ parsed_sass_variables [ ] = $ sass -> parseVariables ( \ Pressbooks \ Utility \ get_contents ( $ file ) ) ; } } set_transient ( $ transient_name , $ parsed_sass_variables ) ; } foreach ( $ parsed_sass_variables as $ parsed_variables ) { foreach ( $ overrides as $ sass_var => $ wp_option ) { if ( isset ( $ parsed_variables [ $ sass_var ] ) ) { if ( ! empty ( $ parsed_variables [ $ sass_var ] ) ) { $ defaults [ $ wp_option ] = $ parsed_variables [ $ sass_var ] ; // Override default with new value } } } } return $ defaults ; }
Filter the array of default values for the Global options tab.

@param array $defaults

@return array $defaults
Filter the array of default values for the Global options tab .