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

Filters rewrite rules used for individual permastructs.


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 ↑


$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 ↑


File: wp-includes/class-wp-rewrite.php. View all references

$rules = apply_filters( "{$permastructname}_rewrite_rules", $rules );

Top ↑


Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.