add rewrite rule for attachments. Closes #875.

This commit is contained in:
Mike Jolley 2012-07-31 14:56:30 +01:00
parent c8033cef51
commit eb532c342c
1 changed files with 5 additions and 0 deletions

View File

@ -780,6 +780,11 @@ class Woocommerce {
)
);
// Sort out attachment urls
$attachment_base = get_option('woocommerce_prepend_shop_page_to_products') == 'yes' ? trailingslashit( $base_slug ) : trailingslashit( _x( 'product', 'slug', 'woocommerce' ) );
add_rewrite_rule( '^' . $attachment_base . '([^/]*)/([^/]*)/([^/]*)/?', 'index.php?attachment=$matches[3]', 'top' );
register_post_type( "product_variation",
array(
'labels' => array(