custom-rewrite-qrh.php
· 487 B · PHP
Исходник
// force URL rewrite for QRh
function custom_rewrite_rule() {
// Adding a rewrite rule that maps the new URL to the internal query for product-category/outlet.
add_rewrite_rule('^tienda/outlet/?$', 'index.php?product_cat=outlet', 'top');
}
add_action('init', 'custom_rewrite_rule');
function custom_rewrite_tag() {
// Adding the custom query var to ensure WordPress recognizes it.
add_rewrite_tag('%product_cat%', '([^&]+)');
}
add_action('init', 'custom_rewrite_tag');
1 | // force URL rewrite for QRh |
2 | function custom_rewrite_rule() { |
3 | // Adding a rewrite rule that maps the new URL to the internal query for product-category/outlet. |
4 | add_rewrite_rule('^tienda/outlet/?$', 'index.php?product_cat=outlet', 'top'); |
5 | } |
6 | add_action('init', 'custom_rewrite_rule'); |
7 | |
8 | function custom_rewrite_tag() { |
9 | // Adding the custom query var to ensure WordPress recognizes it. |
10 | add_rewrite_tag('%product_cat%', '([^&]+)'); |
11 | } |
12 | add_action('init', 'custom_rewrite_tag'); |
13 |