apply_filters( 'root_rewrite_rules', string[] $root_rewrite )
- Since
- 1.5.0
Filters rewrite rules used for root-level archives.
Description
Likely root-level archives would include pagination rules for the homepage as well as site-wide post feeds (e.g. /feed/, and /feed/atom/).
Compatibility
- WordPress
- since 1.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$root_rewritestring[]- Array of root-level rewrite rules, keyed by their regex pattern.
Where this hook fires · 1
wp-includes/class-wp-rewrite.php:1348WP_Rewrite::rewrite_rules()
Source code
* as well as site-wide post feeds (e.g. `/feed/`, and `/feed/atom/`). * * @since 1.5.0 * * @param string[] $root_rewrite Array of root-level rewrite rules, keyed by their regex pattern. */ $root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite ); // Comments rewrite rules. $comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, false, true, true, false ); /** * Filters rewrite rules used for comment feed archives.Changelog
Introduced in 1.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.