Changeset 1910
- Timestamp:
- 12/04/2004 12:12:08 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-blog-header.php
r1909 r1910 208 208 if ($pagenow == 'index.php') { 209 209 if (! isset($wp_did_template_redirect)) { 210 $wp_did_template_redirect = true; 211 do_action('template_redirect', ''); 210 212 if (is_feed()) { 211 213 $wp_did_template_redirect = true; -
trunk/wp-includes/classes.php
r1908 r1910 705 705 var $date_structure; 706 706 var $front; 707 var $ prefix= '';707 var $root = ''; 708 708 var $index = 'index.php'; 709 709 var $matches = ''; 710 var $rules; 710 711 var $rewritecode = 711 712 array( … … 877 878 } 878 879 879 function generate_rewrite_rules($permalink_structure = '', $forcomments = false) { 880 function add_rewrite_tag($tag, $pattern, $query) { 881 $this->rewritecode[] = $tag; 882 $this->rewritereplace[] = $pattern; 883 $this->queryreplace[] = $query; 884 } 885 886 function generate_rewrite_rules($permalink_structure = '', $page = true, $feed = true, $forcomments = false) { 880 887 $feedregex2 = '(feed|rdf|rss|rss2|atom)/?$'; 881 888 $feedregex = 'feed/' . $feedregex2; … … 933 940 $feedquery2 .= '&withcomments=1'; 934 941 } 935 936 $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2, $pagematch => $pagequery); 942 943 $rewrite = array(); 944 if ($feed) 945 $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2); 946 if ($page) 947 $rewrite = $rewrite + array($pagematch => $pagequery); 937 948 938 949 if ($num_toks) { … … 981 992 982 993 // Root 983 $root_rewrite = $this->generate_rewrite_rules($this-> prefix. '/');994 $root_rewrite = $this->generate_rewrite_rules($this->root . '/'); 984 995 985 996 // Comments 986 $comments_rewrite = $this->generate_rewrite_rules($this-> prefix . 'comments', true);997 $comments_rewrite = $this->generate_rewrite_rules($this->root . 'comments',true, true, true); 987 998 988 999 // Search 989 $search_structure = $this-> prefix. "search/%search%";1000 $search_structure = $this->root . "search/%search%"; 990 1001 $search_rewrite = $this->generate_rewrite_rules($search_structure); 991 1002 … … 1001 1012 1002 1013 // Deprecated style static pages 1003 $page_structure = $this-> prefix. 'site/%pagename%';1014 $page_structure = $this->root . 'site/%pagename%'; 1004 1015 $old_page_rewrite = $this->generate_rewrite_rules($page_structure); 1005 1016 1006 1017 // Put them together. 1007 $this->rewrite = $page_rewrite + $root_rewrite + $comments_rewrite + $old_page_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite; 1008 1009 $this->rewrite = apply_filters('rewrite_rules_array', $this->rewrite); 1010 return $this->rewrite; 1018 $this->rules = $page_rewrite + $root_rewrite + $comments_rewrite + $old_page_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite; 1019 1020 do_action('generate_rewrite_rules', ''); 1021 $this->rules = apply_filters('rewrite_rules_array', $this->rules); 1022 return $this->rules; 1011 1023 } 1012 1024 … … 1030 1042 $this->matches = ''; 1031 1043 $rewrite = $this->rewrite_rules(); 1032 1033 1044 $num_rules = count($rewrite); 1034 1045 $rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" . … … 1062 1073 $this->permalink_structure = get_settings('permalink_structure'); 1063 1074 $this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%')); 1064 $this-> prefix= '';1075 $this->root = ''; 1065 1076 if ($this->using_index_permalinks()) { 1066 $this-> prefix= $this->index . '/';1077 $this->root = $this->index . '/'; 1067 1078 } 1068 1079 $this->category_base = get_settings('category_base'); -
trunk/wp-includes/functions.php
r1908 r1910 2057 2057 add_query_arg($key, '', $query); 2058 2058 } 2059 2060 function load_template($file) { 2061 global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, 2062 $wp_rewrite, $wpdb; 2063 2064 extract($wp_query->query_vars); 2065 2066 include($file); 2067 } 2059 2068 ?>
Note: See TracChangeset
for help on using the changeset viewer.