post_link filter and rewrite rules
-
Hello everyone,
Could someone explain me the mechanics of post_link filter and rewrite rules?
Once the permalink is modified through a post_link filter, is the updated permalink be passed through the rewrite rules again?
Considering these rules
$regex = '/dl/.*/?'; rewrite = 'index.php?pagename=dl'; add_rewrite_rule( $regex, $rewrite, 'top' ); $regex = '/(en|fr)/dl/.*/?'; rewrite = 'index.php?pagename=dl&lang=$matches[1]'; add_rewrite_rule( $regex, $rewrite, 'top' );
The URL is https://www.next.ca/dl/aa/aa/00/ri/00/?lang=fr
with a post_link filter, the updated permalink is
https://www.next.ca/fr/dl/aa/aa/00/ri/00/?lang=fr
(You will recognize Polylang’s doing)Will the updated permalink be passed through the rewrite rules again and be caught by second rule (and index.php?pagename=dl&lang=fr be served)?
Or is it another mechanism?
Thanks in advance for your explanations.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘post_link filter and rewrite rules’ is closed to new replies.