root_rewrite_rules WordPress Filter Hook

This hook is called when WordPress is rewriting the rules for the root of the site. This can be useful for creating a custom home page or customizing the way WordPress handles requests for the root of the site.

apply_filters( 'root_rewrite_rules', string[] $root_rewrite ) #

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/).


Top ↑

Parameters

$root_rewrite

(string[])Array of root-level rewrite rules, keyed by their regex pattern.


Top ↑

Source

File: wp-includes/class-wp-rewrite.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.