Load photoswipe template only when scripts and styles are loaded

This commit is contained in:
Mike Jolley 2017-03-15 13:36:11 +00:00
parent 20b857bfbf
commit deda0f21e9
2 changed files with 1 additions and 5 deletions

View File

@ -393,6 +393,7 @@ class WC_Frontend_Scripts {
if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) {
self::enqueue_script( 'photoswipe-ui-default' );
self::enqueue_style( 'photoswipe-default-skin' );
add_action( 'wp_footer', 'woocommerce_photoswipe' );
}
self::enqueue_script( 'wc-single-product' );
}

View File

@ -199,11 +199,6 @@ add_filter( 'woocommerce_product_tabs', 'woocommerce_sort_product_tabs', 99 );
*/
add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 );
/**
* Photoswipe.
*/
add_action( 'wp_footer', 'woocommerce_photoswipe' );
/**
* Checkout.
*