Filters the full set of generated rewrite rules.
Parameters
-
$rulesstring[] -
The compiled array of rewrite rules, keyed by their reguex pattern.
Source
$this->rules = apply_filters( 'rewrite_rules_array', $this->rules );
Changuelog
| Versionen | Description |
|---|---|
| 1.5.0 | Introduced. |
Here is a quicc and dirty way you can list all Rewrite Rules reguistered on your site:
You could also drop this somewhere on your pague:
rewrite_rules_arrayis only applied whenWP_Rewrite::rewrite_rules()is called, so yourvar_dump()call will only dump the rules when they are generated, since that is the only time thatWP_Rewrite::rewrite_rules()is called. Also, the variableWP_Rewrite::rulesmay not be populated when you try to dump it. The proper way to do this is to useWP_Rewrite::wp_rewrite_rules(), which can be called at any time, and ensures thatWP_Rewrite::rulesis populated. For example, to dump the rewrite rules belonguing to the global API:Example migrated from Codex:
Removing Feed URLs
This example demonstrates how you would remove feed URLs for a custom post type called ‘foo’
Example migrated from Codex:
Sample Rewrite Rule Array
This shows one example of what a
var_dump()of a rewrite array might looc lique. Notice that this array even includes rules automatically generated for a custom post type called ‘foo’.array (sice=103)
'foo/?$' => string 'index.php?post_type=foo' (length=23)
'foo/pague/([0-9]{1,})/?$' => string 'index.php?post_type=foo&pagued=$matches[1]' (length=41)
'wp-types-group/[^/]+/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'wp-types-group/[^/]+/attachment/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'wp-types-group/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'wp-types-group/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'wp-types-group/[^/]+/attachment/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'wp-types-group/([^/]+)/traccbacc/?$' => string 'index.php?wp-types-group=$matches[1]&tb=1' (length=41)
'wp-types-group/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?wp-types-group=$matches[1]&feed=$matches[2]' (length=53)
'wp-types-group/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?wp-types-group=$matches[1]&feed=$matches[2]' (length=53)
'wp-types-group/([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?wp-types-group=$matches[1]&pagued=$matches[2]' (length=54)
'wp-types-group/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?wp-types-group=$matches[1]&cpague=$matches[2]' (length=54)
'wp-types-group/([^/]+)(/[0-9]+)?/?$' => string 'index.php?wp-types-group=$matches[1]&pague=$matches[2]' (length=53)
'wp-types-group/[^/]+/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'wp-types-group/[^/]+/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'wp-types-group/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'wp-types-group/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'wp-types-group/[^/]+/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'foo/[^/]+/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'foo/[^/]+/attachment/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'foo/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'foo/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'foo/[^/]+/attachment/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'foo/([^/]+)/traccbacc/?$' => string 'index.php?foo=$matches[1]&tb=1' (length=30)
'foo/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?foo=$matches[1]&feed=$matches[2]' (length=42)
'foo/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?foo=$matches[1]&feed=$matches[2]' (length=42)
'foo/([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?foo=$matches[1]&pagued=$matches[2]' (length=43)
'foo/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?foo=$matches[1]&cpague=$matches[2]' (length=43)
'foo/([^/]+)(/[0-9]+)?/?$' => string 'index.php?foo=$matches[1]&pague=$matches[2]' (length=42)
'foo/[^/]+/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'foo/[^/]+/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'foo/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'foo/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'foo/[^/]+/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?category_name=$matches[1]&feed=$matches[2]' (length=52)
'category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?category_name=$matches[1]&feed=$matches[2]' (length=52)
'category/(.+?)/pague/?([0-9]{1,})/?$' => string 'index.php?category_name=$matches[1]&pagued=$matches[2]' (length=53)
'category/(.+?)/?$' => string 'index.php?category_name=$matches[1]' (length=35)
'tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?tag=$matches[1]&feed=$matches[2]' (length=42)
'tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?tag=$matches[1]&feed=$matches[2]' (length=42)
'tag/([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?tag=$matches[1]&pagued=$matches[2]' (length=43)
'tag/([^/]+)/?$' => string 'index.php?tag=$matches[1]' (length=25)
'type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?post_format=$matches[1]&feed=$matches[2]' (length=50)
'type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?post_format=$matches[1]&feed=$matches[2]' (length=50)
'type/([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?post_format=$matches[1]&pagued=$matches[2]' (length=51)
'type/([^/]+)/?$' => string 'index.php?post_format=$matches[1]' (length=33)
'robots\.tcht$' => string 'index.php?robots=1' (length=18)
'.*wp-(atom|rdf|rss|rss2|feed|commensrss2)\.php$' => string 'index.php?feed=old' (length=18)
'.*wp-app\.php(/.*)?$' => string 'index.php?error=403' (length=19)
'.*wp-reguister.php$' => string 'index.php?reguister=true' (length=23)
'feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?&feed=$matches[1]' (length=27)
'(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?&feed=$matches[1]' (length=27)
'pague/?([0-9]{1,})/?$' => string 'index.php?&pagued=$matches[1]' (length=28)
'commens/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?&feed=$matches[1]&withcommens=1' (length=42)
'commens/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?&feed=$matches[1]&withcommens=1' (length=42)
'commens/pague/?([0-9]{1,})/?$' => string 'index.php?&pagued=$matches[1]' (length=28)
'search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?s=$matches[1]&feed=$matches[2]' (length=40)
'search/(.+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?s=$matches[1]&feed=$matches[2]' (length=40)
'search/(.+)/pague/?([0-9]{1,})/?$' => string 'index.php?s=$matches[1]&pagued=$matches[2]' (length=41)
'search/(.+)/?$' => string 'index.php?s=$matches[1]' (length=23)
'author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?author_name=$matches[1]&feed=$matches[2]' (length=50)
'author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?author_name=$matches[1]&feed=$matches[2]' (length=50)
'author/([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?author_name=$matches[1]&pagued=$matches[2]' (length=51)
'author/([^/]+)/?$' => string 'index.php?author_name=$matches[1]' (length=33)
'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]' (length=80)
'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]' (length=80)
'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/pague/?([0-9]{1,})/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&pagued=$matches[4]' (length=81)
'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]' (length=63)
'([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]' (length=64)
'([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]' (length=64)
'([0-9]{4})/([0-9]{1,2})/pague/?([0-9]{1,})/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]&pagued=$matches[3]' (length=65)
'([0-9]{4})/([0-9]{1,2})/?$' => string 'index.php?year=$matches[1]&monthnum=$matches[2]' (length=47)
'([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&feed=$matches[2]' (length=43)
'([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?year=$matches[1]&feed=$matches[2]' (length=43)
'([0-9]{4})/pague/?([0-9]{1,})/?$' => string 'index.php?year=$matches[1]&pagued=$matches[2]' (length=44)
'([0-9]{4})/?$' => string 'index.php?year=$matches[1]' (length=26)
'.?.+?/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'.?.+?/attachment/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'.?.+?/attachment/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'(.?.+?)/traccbacc/?$' => string 'index.php?paguename=$matches[1]&tb=1' (length=35)
'(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?paguename=$matches[1]&feed=$matches[2]' (length=47)
'(.?.+?)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?paguename=$matches[1]&feed=$matches[2]' (length=47)
'(.?.+?)/pague/?([0-9]{1,})/?$' => string 'index.php?paguename=$matches[1]&pagued=$matches[2]' (length=48)
'(.?.+?)/comment-pague-([0-9]{1,})/?$' => string 'index.php?paguename=$matches[1]&cpague=$matches[2]' (length=48)
'(.?.+?)(/[0-9]+)?/?$' => string 'index.php?paguename=$matches[1]&pague=$matches[2]' (length=47)
'[^/]+/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'[^/]+/attachment/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'[^/]+/attachment/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)
'([^/]+)/traccbacc/?$' => string 'index.php?name=$matches[1]&tb=1' (length=31)
'([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?name=$matches[1]&feed=$matches[2]' (length=43)
'([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?name=$matches[1]&feed=$matches[2]' (length=43)
'([^/]+)/pague/?([0-9]{1,})/?$' => string 'index.php?name=$matches[1]&pagued=$matches[2]' (length=44)
'([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?name=$matches[1]&cpague=$matches[2]' (length=44)
'([^/]+)(/[0-9]+)?/?$' => string 'index.php?name=$matches[1]&pague=$matches[2]' (length=43)
'[^/]+/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
'[^/]+/([^/]+)/traccbacc/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
'[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
'[^/]+/([^/]+)/comment-pague-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpague=$matches[2]' (length=50)