fixed the product attachment urls when use n/%product_cat% as base url, closes #5159

This commit is contained in:
claudiosmweb 2014-06-02 14:48:52 -03:00
parent 4c18ab831a
commit 6577d8086b
1 changed files with 5 additions and 1 deletions

View File

@ -209,7 +209,7 @@ class WC_Post_types {
);
}
}
do_action( 'woocommerce_after_register_taxonomy' );
}
}
@ -262,6 +262,10 @@ class WC_Post_types {
)
);
if ( preg_match( '/\/(.+)(\/%product_cat%)$/' , $product_permalink, $matches ) ) {
add_rewrite_rule( '^' . $matches[1] . '/.+?/[^/]+/([^/]+)/?$', 'index.php?attachment=$matches[1]', 'top' );
}
register_post_type( "product_variation",
apply_filters( 'woocommerce_register_post_type_product_variation',
array(