All Questions
Tagged with rewrite-tag regex
3
questions
4
votes
1answer
695 views
Regex in add_rewrite_tag not accepting OR operators?
I am trying to add a custom field to the post permalinks by using a combo of add_rewrite_tag and applying a post_link filter.
What I am aiming for is something like this:
http://example.com/%...
0
votes
3answers
745 views
Why isn't my rewrite rule working when there is no second parameter?
Here is my rewrite rule code:
add_rewrite_rule('tides/([^/]+)/([^/]*)', 'index.php?page_id=4348&location=$matches[1]&month=$matches[2]', 'top');
add_rewrite_tag('%location%', '([^&]+)');
...
3
votes
0answers
191 views
What add_rewrite_tag()'s RegEx matches against?
I'm trying to figure out wether I can specify the position of the string to match (i.e. immediately after the domain) to reduce the chances of matching something else, but I don't even know what the ...