From 89fe0ff804e7c6497ebacc8b341ac89974f6f255 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 21 May 2007 18:37:58 +0000 Subject: WP Merge to rev 5499, this is a big one! Test it before you put it live! Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/rewrite.php | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'wp-includes/rewrite.php') diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index d22d3fc..eb10bf7 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -46,11 +46,11 @@ define('EP_ROOT', 64 ); define('EP_COMMENTS', 128 ); define('EP_SEARCH', 256 ); define('EP_CATEGORIES', 512 ); -define('EP_AUTHORS', 1024); -define('EP_PAGES', 2048); +define('EP_AUTHORS', 2048); +define('EP_PAGES', 4096); //pseudo-places define('EP_NONE', 0 ); -define('EP_ALL', 255); +define('EP_ALL', 8191); //and an endpoint, like /trackback/ function add_rewrite_endpoint($name, $places) { @@ -62,6 +62,8 @@ function add_rewrite_endpoint($name, $places) { // determine the post ID it represents. function url_to_postid($url) { global $wp_rewrite; + + $url = apply_filters('url_to_postid', $url); // First, check to see if there is a 'p=N' or 'page_id=N' to match against preg_match('#[?&](p|page_id)=(\d+)#', $url, $values); @@ -197,6 +199,7 @@ class WP_Rewrite { '([^/]+)', '([0-9]+)', '(.+?)', + '(.+?)', '([^/]+)', '([^/]+)', '(.+)' @@ -582,6 +585,16 @@ class WP_Rewrite { if ($paged) //...and /page/xx ones $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); + //do endpoints + if ($endpoints) { + foreach ($ep_query_append as $regex => $ep) { + //add the endpoints on if the mask fits + if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { + $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); + } + } + } + //if we've got some tags in this dir if ($num_toks) { $post = false; @@ -599,16 +612,6 @@ class WP_Rewrite { $page = true; } - //do endpoints - if ($endpoints) { - foreach ($ep_query_append as $regex => $ep) { - //add the endpoints on if the mask fits - if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { - $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); - } - } - } - //if we're creating rules for a permalink, do all the endpoints like attachments etc if ($post) { $post = true; @@ -869,7 +872,7 @@ class WP_Rewrite { if ($this->using_index_permalinks()) { $this->root = $this->index . '/'; } - $this->category_base = get_option('category_base'); + $this->category_base = get_option( 'category_base' ); unset($this->category_structure); unset($this->author_structure); unset($this->date_structure); -- cgit