Astra_Cache::setup_cache()

Fetch theme CSS data to be added in the dynamic CSS file.


Description


Return

(void)


Source

File: classes/cache/class-astra-cache.php

	public function setup_cache() {

		$assets_info = $this->get_asset_info( 'theme' );

		if ( array_key_exists( 'path', $assets_info ) && ! file_exists( $assets_info['path'] ) && ! self::inline_assets() ) {
			$theme_css_data = $this->get_dynamic_css();

			// Return if there is no data to add in the css file.
			if ( empty( $theme_css_data ) ) {
				return;
			}

			$this->write_assets( $theme_css_data, 'theme' );
		}

		if ( true === Astra_Enqueue_Scripts::enqueue_theme_assets() ) {
			// Call enqueue styles function.
			$this->enqueue_styles( 'theme' );
		}

	}

Changelog

Changelog
Version Description
2.1.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.