{$permastructname}_rewrite_rules WordPress Filter Hook

This hook is called when the {$permastructname} rewrite rules are generated. It can be used to add additional rewrite rules for custom post types and taxonomies.

apply_filters( "{$permastructname}_rewrite_rules", string[] $rules ) #

Filters rewrite rules used for individual permastructs.


Description

The dynamic portion of the hook name, $permastructname, refers to the name of the registered permastruct.

Possible hook names include:

  • category_rewrite_rules
  • post_format_rewrite_rules
  • post_tag_rewrite_rules

Top ↑

Parameters

$rules

(string[])Array of rewrite rules generated for the current permastruct, keyed by their regex pattern.


Top ↑

More Information

This filter hook allows you to modify various custom permastructs, such as those generated for custom post types or taxonomies (both built-in or custom).


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.1.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.