Prevent is_page being true. Closes #529.
This commit is contained in:
parent
74a2662c59
commit
6b788cdd93
|
@ -24,10 +24,13 @@ function woocommerce_mail( $to, $subject, $message, $headers = "Content-Type: te
|
||||||
* WooCommerce page IDs
|
* WooCommerce page IDs
|
||||||
*
|
*
|
||||||
* retrieve page ids - used for myaccount, edit_address, change_password, shop, cart, checkout, pay, view_order, thanks, terms, order_tracking
|
* retrieve page ids - used for myaccount, edit_address, change_password, shop, cart, checkout, pay, view_order, thanks, terms, order_tracking
|
||||||
|
*
|
||||||
|
* returns -1 if no page is found
|
||||||
**/
|
**/
|
||||||
if (!function_exists('woocommerce_get_page_id')) {
|
if (!function_exists('woocommerce_get_page_id')) {
|
||||||
function woocommerce_get_page_id( $page ) {
|
function woocommerce_get_page_id( $page ) {
|
||||||
return apply_filters('woocommerce_get_' . $page . '_page_id', get_option('woocommerce_' . $page . '_page_id'));
|
$page = apply_filters('woocommerce_get_' . $page . '_page_id', get_option('woocommerce_' . $page . '_page_id'));
|
||||||
|
return ($page) ? $page : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ function woocommerce_redirects() {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
// When default permalinks are enabled, redirect shop page to post type archive url
|
// When default permalinks are enabled, redirect shop page to post type archive url
|
||||||
if ( isset($_GET['page_id']) && get_option( 'permalink_structure' )=="" && $_GET['page_id'] == woocommerce_get_page_id('shop') ) :
|
if ( isset($_GET['page_id']) && $_GET['page_id'] > 0 && get_option( 'permalink_structure' )=="" && $_GET['page_id'] == woocommerce_get_page_id('shop') ) :
|
||||||
wp_safe_redirect( get_post_type_archive_link('product') );
|
wp_safe_redirect( get_post_type_archive_link('product') );
|
||||||
exit;
|
exit;
|
||||||
endif;
|
endif;
|
||||||
|
|
Loading…
Reference in New Issue