Changeset 34946 for trunk/src/wp-includes/rewrite-functions.php
- Timestamp:
- 10/08/2015 05:27:05 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rewrite-functions.php
r34890 r34946 8 8 9 9 /** 10 * Adds a straight rewrite rule. 10 * Adds a rewrite rule that transforms a URL structure to a set of query vars. 11 * 12 * Any value in the $after parameter that isn't 'bottom' will result in the rule 13 * being placed at the top of the rewrite rules. 11 14 * 12 15 * @since 2.1.0 13 * @since 4.4.0 Array support was added to the `$ redirect` parameter.16 * @since 4.4.0 Array support was added to the `$query` parameter. 14 17 * 15 18 * @global WP_Rewrite $wp_rewrite WordPress Rewrite Component. 16 19 * 17 * @param string $regex Regular Expression to match request against.18 * @param string|array $ redirect Page to redirect to, or array of query vars and values.19 * @param string $after Optional. Location where to insert the new rule. Accepts 'top',20 * 21 */ 22 function add_rewrite_rule( $regex, $ redirect, $after = 'bottom' ) {23 global $wp_rewrite; 24 25 $wp_rewrite->add_rule( $regex, $ redirect, $after );20 * @param string $regex Regular expression to match request against. 21 * @param string|array $query The corresponding query vars for this rewrite rule. 22 * @param string $after Optional. Priority of the new rule. Accepts 'top' 23 * or 'bottom'. Default 'bottom'. 24 */ 25 function add_rewrite_rule( $regex, $query, $after = 'bottom' ) { 26 global $wp_rewrite; 27 28 $wp_rewrite->add_rule( $regex, $query, $after ); 26 29 } 27 30
Note: See TracChangeset
for help on using the changeset viewer.