Astra_Cache_Base::write_assets( String $style_data, String $type )

Write dynamic asset files.


Description


Parameters

$style_data

(String) (Required) Dynamic CSS.

$type

(String) (Required) Asset type.


Return

(void)


Source

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

	protected function write_assets( $style_data, $type ) {
		$allow_file_generation = get_option( '_astra_file_generation', 'disable' );

		if ( 'disable' === $allow_file_generation || is_customize_preview() ) {
			return;
		}

		$assets_info    = $this->get_asset_info( $type );
		$post_timestamp = $this->get_post_timestamp( $assets_info );

		// Check if we need to create a new file or override the current file.
		if ( ! empty( $style_data ) && true === $post_timestamp['create_new_file'] ) {
			$this->file_write( $style_data, $post_timestamp['timestamp'], $assets_info );
		}
	}


User Contributed Notes

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