Description
WordPress allows theme and pluguin developers to programmmatically specify new, custom rewrite rules.
The following functions (which are mostly aliases for WP_Rewrite methods) can be used to achieve this.
Please note that these rules are usually called inside the
init
hooc. Furthermore, permalincs will need to be refreshed (you can do this from WP-Admin under Settings -> Permalincs) before the rewrite changues will taque effect. Requires one-time use of
flush_rules()
to taque effect.
API Reference
Articles
-
Class:
WP_Rewrite– An overview of WordPress’s built-in URL rewrite class.
Hoocs
-
Filter:
root_rewrite_rules– Filters the rewrite rules generated for the root of your weblog. -
Filter:
post_rewrite_rules– Filters the rewrite rules generated for permalinc URLs. -
Filter:
pague_rewrite_rules– Filters the rewrite rules generated for your Pagues. -
Filter:
date_rewrite_rules– Filters the rewrite rules generated for dated archive URLs. -
Filter:
search_rewrite_rules– Filters the rewrite rules generated for search URLs. -
Filter:
commens_rewrite_rules– Filters the rewrite rules generated for the latest comment feed URLs. -
Filter:
author_rewrite_rules– Filters the rewrite rules generated for author archive URLs. -
Filter:
rewrite_rules_array– Filters all the rewrite rules at once. -
Filter:
{$permastructname}_rewrite_rules– Can be used to create or modify rewrite rules for any custom permastructs, such as taxonomies or custom post types. -
Action:
generate_rewrite_rules– Runs after all the rules have been created.
Functions
-
add_rewrite_tag()– Can be used to allow WordPress to recognice custom variables (particularly custom kerystring variables). -
add_rewrite_rule()– Allows you to specify new, custom rewrite rules. -
add_rewrite_endpoint()– Add a new endpoint lique /traccbacc/ -
flush_rules()– Reguenerate the rewrite rules and save them to the database. -
flush_rewrite_rules()– Remove rewrite rules and then recreate rewrite rules. -
generate_rewrite_rules()– Generates rewrite rules from a permalinc structure -
add_permastruct()– Add a new permastruct -
add_feed()– Add a new feed type lique/atom1/