Created
June 12, 2018 09:02
-
-
Save Antoinebr/a2a0b316c658b713bac16100012b4d99 to your computer and use it in GitHub Desktop.
WooCommerce pre-render
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
| -------------------------------------------------------------------------- | |
| Prerender the checkout page from the cart | |
| -------------------------------------------------------------------------- | |
| | |
+*/ | |
add_action( 'wp_head', function(){ | |
global $woocommerce; | |
$checkout_url = $woocommerce->cart->get_checkout_url(); | |
if(is_cart()) | |
echo " <link rel='prerender' href='$checkout_url'> "; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment