WordPress Rewrite Component.
The WordPress Rewrite class writes the rewrite module rules to the .htaccess file. It also handles parsing the request to get the correct setup for the WordPress Query class.
The Rewrite along with WP class function as a front controller for WordPress. You can add rules to trigger your page view and processing using this component. The full functionality of a front controller does not exist, meaning you can't define how the template files load based on the rewrite rules.
Located in /wp-includes/rewrite.php (line 394)
The name of the index file which is the entry point to all requests.
Could post permalinks be confused with those of pages?
If the first rewrite tag in the post permalink structure is one that could also match a page name (e.g. %postname% or %author%) then this flag is set to true. Prior to WordPress 3.3 this flag indicated that every page would have a set of rules added to the top of the rewrite rules array. Now it tells WP::parse_request() to check if a URL matching the page permastruct is actually a page before accepting it.
Whether to write every mod_rewrite rule for WordPress into the .htaccess file.
This is off by default, turning it on might print a lot of rewrite rules to the .htaccess file.
Constructor - Calls init(), which runs setup.
Add an endpoint, like /trackback/.
See add_rewrite_endpoint() for full documentation.
Add a rule that doesn't redirect to index.php.
Can redirect to any place.
Add a new permalink structure.
A permalink structure (permastruct) is an abstract definition of a set of rewrite rules; it is an easy way of expressing a set of regular expressions that rewrite to a set of query strings. The new permastruct is added to the WP_Rewrite::$extra_permastructs array. When the rewrite rules are built by WP_Rewrite::rewrite_rules() all of these extra permastructs are passed to WP_Rewrite::generate_rewrite_rules() which transforms them into the regular expressions that many love to hate.
The $args parameter gives you control over how WP_Rewrite::generate_rewrite_rules() works on the new permastruct.
Add or update existing rewrite tags (e.g. %postname%).
If the tag already exists, replace the existing pattern and query for that tag, otherwise add the new tag.
Add a straight rewrite rule.
Any value in the $after parameter that isn't 'bottom' will be placed at the top of the rules.
Remove rewrite rules and then recreate rewrite rules.
Calls WP_Rewrite::wp_rewrite_rules() after removing the 'rewrite_rules' option. If the function named 'save_mod_rewrite_rules' exists, it will be called.
Generate Rewrite rules with permalink structure and walking directory only.
Shorten version of WP_Rewrite::generate_rewrite_rules() that allows for shorter list of parameters. See the method for longer description of what generating rewrite rules does.
Generate rewrite rules from a permalink structure.
The main WP_Rewrite function for building the rewrite rule list. The contents of the function is a mix of black magic and regular expressions, so best just ignore the contents and move to the parameters.
Retrieve the author permalink structure.
The permalink structure is front property, author base, and finally '/%author%'. Will set the author_structure property and then return it without attempting to set the value again.
Retrieve the permalink structure for categories.
If the category_base property has no value, then the category structure will have the front property value, followed by 'category', and finally '%category%'. If it does, then the root property will be used, along with the category_base property value.
Retrieve the comment feed permalink structure.
The permalink structure is root property, comment base property, feed base and finally '/%feed%'. Will set the comment_feed_structure property and then return it without attempting to set the value again.
Retrieve date permalink structure, with year, month, and day.
The permalink structure for the date, if not set already depends on the permalink structure. It can be one of three formats. The first is year, month, day; the second is day, month, year; and the last format is month, day, year. These are matched against the permalink structure for which one is used. If none matches, then the default will be used, which is year, month, day.
Prevents post ID and date permalinks from overlapping. In the case of post_id, the date permalink will be prepended with front permalink with 'date/' before the actual permalink to form the complete date permalink structure.
Retrieve the day permalink structure with month and year.
Keeps date permalink structure with all year, month, and day.
Retrieve extra permalink structure by name.
Retrieve the feed permalink structure.
The permalink structure is root property, feed base, and finally '/%feed%'. Will set the feed_structure property and then return it without attempting to set the value again.
Retrieve the month permalink structure without day and with year.
Gets the date permalink structure and strips out the day permalink structures. Keeps the year permalink structure.
Retrieve the page permalink structure.
The permalink structure is root property, and '%pagename%'. Will set the page_structure property and then return it without attempting to set the value again.
Retrieve the search permalink structure.
The permalink structure is root property, search base, and finally '/%search%'. Will set the search_structure property and then return it without attempting to set the value again.
Retrieve the permalink structure for tags.
If the tag_base property has no value, then the tag structure will have the front property value, followed by 'tag', and finally '%tag%'. If it does, then the root property will be used, along with the tag_base property value.
Retrieve the year permalink structure without month and day.
Gets the date permalink structure and strips out the month and day permalink structures.
Retrieve IIS7 URL Rewrite formatted rewrite rules to write to web.config file.
Does not actually write to the web.config file, but creates the rules for the process that will.
Sets up the object's properties.
The 'use_verbose_page_rules' object property will be set to true if the permalink structure begins with one of the following: '%postname%', '%category%', '%tag%', or '%author%'.
Retrieve mod_rewrite formatted rewrite rules to write to .htaccess.
Does not actually write to the .htaccess file, but creates the rules for the process that will.
Will add the non_wp_rules property rules to the .htaccess file before the WordPress rewrite rules one.
Retrieve all of the rewrite rules for pages.
Retrieve all page and attachments for pages URIs.
The attachments are for those that have pages as parents and will be retrieved.
Index for matches for usage in preg_*() functions.
The format of the string is, with empty matches property value, '$NUM'. The 'NUM' will be replaced with the value in the $number parameter. With the matches property not empty, the value of the returned string will contain that value of the matches property. The format then will be '$MATCHES[NUM]', with MATCHES as the value in the property and NUM the value of the $number parameter.
Construct rewrite matches and queries from permalink structure.
Runs the action 'generate_rewrite_rules' with the parameter that is an reference to the current WP_Rewrite instance to further manipulate the permalink structures and rewrite rules. Runs the 'rewrite_rules_array' filter on the full rewrite rule array.
There are two ways to manipulate the rewrite rules, one by hooking into the 'generate_rewrite_rules' action and gaining full control of the object or just manipulating the rewrite rule array before it is passed from the function.
Set the category base for the category permalink.
Will update the 'category_base' option, if there is a difference between the current category base and the parameter value. Calls WP_Rewrite::init() after the option is updated.
Set the main permalink structure for the blog.
Will update the 'permalink_structure' option, if there is a difference between the current permalink structure and the parameter value. Calls WP_Rewrite::init() after the option is updated.
Fires the 'permalink_structure_changed' action once the init call has processed passing the old and new values
Set the tag base for the tag permalink.
Will update the 'tag_base' option, if there is a difference between the current tag base and the parameter value. Calls WP_Rewrite::init() after the option is updated.
Whether permalinks are being used and rewrite module is not enabled.
Means that permalink links are enabled and index.php is in the URL.
Whether permalinks are being used and rewrite module is enabled.
Using permalinks and index.php is not in the URL.
Whether permalinks are being used.
This can be either rewrite module or permalink in the HTTP query string.
Retrieve the rewrite rules.
The difference between this method and WP_Rewrite::rewrite_rules() is that this method stores the rewrite rules in the 'rewrite_rules' option and retrieves it. This prevents having to process all of the permalinks to get the rewrite rules in the form of caching.
Documentation generated on Sat, 18 May 2013 23:19:04 +0000 by phpDocumentor 1.4.1