Pular para o conteúdo Pular para a barra lateral
Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Fuso horário do suporte: Asia/Kathmandu (GMT+05:45)

Este tópico contém 0, tem 1 voices.

Última atualização: adrienR-5 4 meses, 2 semanas atrás.

Assistido por: Shekhar Bhandari.

Autor Posts
junho 24, 2025 às 8:52 am #17163675

adrienR-5

Background of the issue:
I am developing a site and have added some query_vars and rewrite_rule to create dynamic pages.

Here's my current code: "function sws_franchise_reviews_custom_query_vars($vars) {
$vars[] = "franchise_slug";
$vars[] = "franchise_reviews_page";
$vars[] = "franchise_review_id";

return $vars;
}
add_filter("query_vars", "sws_franchise_reviews_custom_query_vars");

function sws_franchise_reviews_custom_rewrite_rule() {
add_rewrite_tag("%franchise_name%", "([^/]+)");
add_rewrite_rule(
"^franchise/([^/]+)/avis/?",
'index.php?franchise_name=$matches[1]&post_type=franchise&franchise_reviews_page=1&do_not_redirect=1',
"top"
);
add_rewrite_rule(
"^franchise/([^/]+)/avis/([^/]+)/?",
'index.php?franchise_name=$matches[1]&post_type=franchise&franchise_reviews_page=1&do_not_redirect=1&franchise_review_id=$matches[2]',
"top"
);
}
add_action("init", "sws_franchise_reviews_custom_rewrite_rule", 10, 0);"

This is working well for my default language (FR).

Symptoms:
I need to create similar functionality for different WPML languages.

Questions:
How can I create similar query_vars and rewrite_rule for different WPML languages?

O tópico '[Fechado] Create query_vars and add_rewrite_rule for alternative WPML languages' está fechado para novas respostas.