Slug options. Closes #288.
This commit is contained in:
parent
a6ca13333a
commit
2a24df0936
|
@ -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 (<code>%s</code>)', 'woothemes' ), $base_slug),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue