diff --git a/admin/admin-settings.php b/admin/admin-settings.php index 03779faba23..9b6550a80d1 100644 --- a/admin/admin-settings.php +++ b/admin/admin-settings.php @@ -331,6 +331,24 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra 'type' => 'checkbox', ), + array( + 'name' => __( 'Product category slug', 'woothemes' ), + 'desc' => __( 'Shows in the product category URLs. Leave blank to use the default slug.', 'woothemes' ), + 'id' => 'woocommerce_product_category_slug', + 'type' => 'text', + 'css' => 'min-width:300px;', + 'std' => '' + ), + + array( + 'name' => __( 'Product tag slug', 'woothemes' ), + 'desc' => __( 'Shows in the product tag URLs. Leave blank to use the default slug.', 'woothemes' ), + 'id' => 'woocommerce_product_tag_slug', + 'type' => 'text', + 'css' => 'min-width:300px;', + 'std' => '' + ), + array( 'name' => __( 'Product base page', 'woothemes' ), 'desc' => sprintf(__( 'Prepend product permalinks with shop base page (%s)', 'woothemes' ), $base_slug), diff --git a/readme.txt b/readme.txt index cbed9bced23..80b5c3a2793 100644 --- a/readme.txt +++ b/readme.txt @@ -92,6 +92,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo * add_to_cart_url shortcode * French translation * Customer note field quote fix +* Moved product-category and tag slugs to settings (page) = 1.3 - 01/12/2011 = * Minor bug fixes + localisations diff --git a/woocommerce_taxonomy.php b/woocommerce_taxonomy.php index 2ee0408f0c2..684c0a662ff 100644 --- a/woocommerce_taxonomy.php +++ b/woocommerce_taxonomy.php @@ -20,6 +20,9 @@ function woocommerce_post_type() { $category_base = (get_option('woocommerce_prepend_shop_page_to_urls')=="yes") ? trailingslashit($base_slug) : ''; + $category_slug = (get_option('woocommerce_product_category_slug')) ? get_option('woocommerce_product_category_slug') : _x('product-category', 'slug', 'woothemes'); + $tag_slug = (get_option('woocommerce_product_tag_slug')) ? get_option('woocommerce_product_tag_slug') : _x('product-tag', 'slug', 'woothemes'); + $product_base = (get_option('woocommerce_prepend_shop_page_to_products')=='yes') ? trailingslashit($base_slug) : trailingslashit(__('product', 'woothemes')); if (get_option('woocommerce_prepend_category_to_products')=='yes') $product_base .= trailingslashit('%product_cat%'); $product_base = untrailingslashit($product_base); @@ -61,7 +64,7 @@ function woocommerce_post_type() { ), 'show_ui' => true, 'query_var' => true, - 'rewrite' => array( 'slug' => $category_base . _x('product-category', 'slug', 'woothemes'), 'with_front' => false ), + 'rewrite' => array( 'slug' => $category_base . $category_slug, 'with_front' => false ), ) ); @@ -84,7 +87,7 @@ function woocommerce_post_type() { ), 'show_ui' => true, 'query_var' => true, - 'rewrite' => array( 'slug' => $category_base . _x('product-tag', 'slug', 'woothemes'), 'with_front' => false ), + 'rewrite' => array( 'slug' => $category_base . $tag_slug, 'with_front' => false ), ) );