add_rewrite_tag
add_rewrite_tag ( $tag, $regex, $query = '' )
Parameters:- (string) tag Name of the new rewrite tag.
- (string) regex Regular expression to substitute the tag for in rewrite rules.
- (string) query Optional. String to append to the rewritten query. Must end in '='. Default empty.
Defined at: - Introduced in WordPress: 2.1.0
- Deprecated in WordPress: —
Description
Adds a new rewrite tag (like %postname%).The `$query` parameter is optional. If it is omitted you must ensure that you call
this on, or before, the {@see 'init'} hook. This is because `$query` defaults to
`$tag=`, and for this to work a new query var has to be added.