Changeset 5150 for trunk/wp-includes/rewrite.php
- Timestamp:
- 03/31/2007 09:19:32 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/rewrite.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r5131 r5150 47 47 define('EP_SEARCH', 256 ); 48 48 define('EP_CATEGORIES', 512 ); 49 define('EP_AUTHORS', 1024); 50 define('EP_PAGES', 2048); 49 define('EP_TAGS', 1024 ); 50 define('EP_AUTHORS', 2048); 51 define('EP_PAGES', 4096); 51 52 //pseudo-places 52 53 define('EP_NONE', 0 ); 53 define('EP_ALL', 4095);54 define('EP_ALL', 8191); 54 55 55 56 //and an endpoint, like /trackback/ … … 151 152 var $use_trailing_slashes; 152 153 var $category_base; 154 var $tag_base; 153 155 var $category_structure; 156 var $tag_structure; 154 157 var $author_base = 'author'; 155 158 var $author_structure; … … 182 185 '%post_id%', 183 186 '%category%', 187 '%tag%', 184 188 '%author%', 185 189 '%pagename%', … … 198 202 '([0-9]+)', 199 203 '(.+?)', 204 '(.+?)', 200 205 '([^/]+)', 201 206 '([^/]+)', … … 214 219 'p=', 215 220 'category_name=', 221 'tag=', 216 222 'author_name=', 217 223 'pagename=', … … 377 383 378 384 return $this->category_structure; 385 } 386 387 function get_tag_permastruct() { 388 if (isset($this->tag_structure)) { 389 return $this->tag_structure; 390 } 391 392 if (empty($this->permalink_structure)) { 393 $this->tag_structure = ''; 394 return false; 395 } 396 397 if (empty($this->tag_base)) 398 $this->tag_structure = $this->front . 'tag/'; 399 else 400 $this->tag_structure = $this->tag_base . '/'; 401 402 $this->tag_structure .= '%tag%'; 403 404 return $this->tag_structure; 379 405 } 380 406 … … 735 761 $category_rewrite = apply_filters('category_rewrite_rules', $category_rewrite); 736 762 763 // Tags 764 $tag_rewrite = $this->generate_rewrite_rules($this->get_tag_permastruct(), EP_TAGS); 765 $tag_rewrite = apply_filters('tag_rewrite_rules', $tag_rewrite); 766 737 767 // Authors 738 768 $author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS); … … 744 774 745 775 // Put them together. 746 $this->rules = array_merge($robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $ author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);776 $this->rules = array_merge($robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules); 747 777 748 778 do_action_ref_array('generate_rewrite_rules', array(&$this)); … … 870 900 $this->root = $this->index . '/'; 871 901 } 872 $this->category_base = get_option('category_base'); 902 $this->category_base = get_option( 'category_base' ); 903 $this->tag_base = get_option( 'tag_base' ); 873 904 unset($this->category_structure); 874 905 unset($this->author_structure); … … 895 926 } 896 927 928 function set_tag_base( $tag_base ) { 929 if ( $tag_base != $this->tag_base ) { 930 update_option( 'tag_base', $tag_base ); 931 $this->init(); 932 } 933 } 934 897 935 function WP_Rewrite() { 898 936 $this->init();
Note: See TracChangeset
for help on using the changeset viewer.