Amp_Assets::filter_stylesheet( string $stylesheet )

Summary

Filter the main stylesheet when we are in AMP paired mode.


Parameters

$stylesheet

(string) (Required) Stylesheet file name.


Return

(mixed)


Source

File: src/BigCommerce/Amp/Amp_Assets.php

	public function filter_stylesheet( $stylesheet ) {
		$debug        = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
		$stylesheet   = $debug ? 'master-amp.css' : 'master-amp.min.css';
		$post         = get_post();
		$cart_page_id = intval( get_option( Settings\Sections\Cart::OPTION_CART_PAGE_ID, 0 ) );
		if ( $post->ID === $cart_page_id ) {
			$stylesheet = $debug ? 'cart-amp.css' : 'cart-amp.min.css';
		}

		return $stylesheet;
	}

User Contributed Notes

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