Skip to content

Instantly share code, notes, and snippets.

@kLOsk
Created November 6, 2018 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kLOsk/4956d724d8f22215b1fbde918e7f88cc to your computer and use it in GitHub Desktop.
Save kLOsk/4956d724d8f22215b1fbde918e7f88cc to your computer and use it in GitHub Desktop.
wc vendors PLL rewrite fix test
function DK_pll_rewrite_basic() {
add_rewrite_rule('(en|de)/(dashboard)/(product)/?$', 'index.php?lang=$matches[1]&pagename=dashboard&object=product', 'top');
add_rewrite_rule('(en|de)/(dashboard)/(product)/(edit)/?$', 'index.php?lang=$matches[1]&pagename=dashboard&object=product&action=edit', 'top');
//add_rewrite_rule('(en|ja)/(product-category)/(.+?)/?$', 'index.php?post_type=product&product_cat=$matches[3]', 'top');
}
add_action('init', 'DK_pll_rewrite_basic', 10, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment