Clarify has_archive

This commit is contained in:
Mike Jolley 2017-11-10 16:32:43 +00:00
parent 5adb1edef5
commit fb8db3313e
1 changed files with 6 additions and 1 deletions

View File

@ -256,7 +256,12 @@ class WC_Post_types {
} }
$shop_page_id = wc_get_page_id( 'shop' ); $shop_page_id = wc_get_page_id( 'shop' );
$has_archive = current_theme_supports( 'woocommerce' ) ? $shop_page_id && get_post( $shop_page_id ) ? urldecode( get_page_uri( $shop_page_id ) ) : 'shop' : false;
if ( current_theme_supports( 'woocommerce' ) ) {
$has_archive = $shop_page_id && get_post( $shop_page_id ) ? urldecode( get_page_uri( $shop_page_id ) ) : 'shop';
} else {
$has_archive = false;
}
register_post_type( 'product', register_post_type( 'product',
apply_filters( 'woocommerce_register_post_type_product', apply_filters( 'woocommerce_register_post_type_product',