search_rewrite_rules WordPress Filter Hook

The search_rewrite_rules hook is used to filter the search rewrite rules before they are generated. This can be used to add or remove rules, or to modify the query string or redirect URL.

apply_filters( 'search_rewrite_rules', string[] $search_rewrite ) #

Filters rewrite rules used for search archives.


Description

Likely search-related archives include /search/search+query/ as well as pagination and feed paths for a search.


Top ↑

Parameters

$search_rewrite

(string[])Array of rewrite rules for search queries, 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.