Later hook for template redirect and the_post Closes #4984
This commit is contained in:
parent
30eee00c1b
commit
d9c10aae62
|
@ -65,6 +65,7 @@ function wc_template_redirect() {
|
|||
WC()->shipping();
|
||||
}
|
||||
}
|
||||
add_action( 'template_redirect', 'wc_template_redirect' );
|
||||
|
||||
/**
|
||||
* When the_post is called, put product data into a global.
|
||||
|
@ -85,6 +86,7 @@ function wc_setup_product_data( $post ) {
|
|||
|
||||
return $GLOBALS['product'];
|
||||
}
|
||||
add_action( 'the_post', 'wc_setup_product_data' );
|
||||
|
||||
/**
|
||||
* Products RSS Feed.
|
||||
|
|
|
@ -12,13 +12,17 @@
|
|||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
add_action( 'the_post', 'wc_setup_product_data' );
|
||||
add_action( 'template_redirect', 'wc_template_redirect' );
|
||||
add_filter( 'body_class', 'wc_body_class' );
|
||||
add_filter( 'post_class', 'wc_product_post_class', 20, 3 );
|
||||
|
||||
/**
|
||||
* WP Header
|
||||
*
|
||||
* @see wc_products_rss_feed()
|
||||
* @see wc_generator_tag()
|
||||
*/
|
||||
add_action( 'wp_head', 'wc_products_rss_feed' );
|
||||
add_action( 'wp_head', 'wc_generator_tag' );
|
||||
add_action( 'wp_footer', 'wc_print_js', 25 );
|
||||
|
||||
/**
|
||||
* Content Wrappers
|
||||
|
@ -177,8 +181,10 @@ add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
|
|||
/**
|
||||
* Footer
|
||||
*
|
||||
* @see wc_print_js()
|
||||
* @see woocommerce_demo_store()
|
||||
*/
|
||||
add_action( 'wp_footer', 'wc_print_js', 25 );
|
||||
add_action( 'wp_footer', 'woocommerce_demo_store' );
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue