Ticket #19876: 19876.diff
File 19876.diff, 3.9 KB (added by , 13 years ago) |
---|
-
wp-includes/rewrite.php
816 816 // the extra .? at the beginning prevents clashes with other regular expressions in the rules array 817 817 $this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' ); 818 818 819 return $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES );819 return $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES, false, true, false, false ); 820 820 } 821 821 822 822 /** … … 1489 1489 } 1490 1490 1491 1491 // Post 1492 $post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK);1493 $post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite);1492 $post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK, false, true, false, false ); 1493 $post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite ); 1494 1494 1495 1495 // Date 1496 $date_rewrite = $this->generate_rewrite_rules( $this->get_date_permastruct(), EP_DATE);1497 $date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite);1496 $date_rewrite = $this->generate_rewrite_rules( $this->get_date_permastruct(), EP_DATE ); 1497 $date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite ); 1498 1498 1499 1499 // Root 1500 $root_rewrite = $this->generate_rewrite_rules( $this->root . '/', EP_ROOT);1501 $root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite);1500 $root_rewrite = $this->generate_rewrite_rules( $this->root . '/', EP_ROOT ); 1501 $root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite ); 1502 1502 1503 1503 // Comments 1504 $comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, true, true, true, false);1505 $comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_rewrite);1504 $comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, true, true, true, false ); 1505 $comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_rewrite ); 1506 1506 1507 1507 // Search 1508 $search_structure = $this->get_search_permastruct(); 1509 $search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH); 1510 $search_rewrite = apply_filters('search_rewrite_rules', $search_rewrite); 1508 $search_rewrite = $this->generate_rewrite_rules( $this->get_search_permastruct(), EP_SEARCH ); 1509 $search_rewrite = apply_filters( 'search_rewrite_rules', $search_rewrite ); 1511 1510 1512 1511 // Authors 1513 $author_rewrite = $this->generate_rewrite_rules( $this->get_author_permastruct(), EP_AUTHORS);1514 $author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite);1512 $author_rewrite = $this->generate_rewrite_rules( $this->get_author_permastruct(), EP_AUTHORS ); 1513 $author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite ); 1515 1514 1516 1515 // Pages 1517 1516 $page_rewrite = $this->page_rewrite_rules(); 1518 $page_rewrite = apply_filters( 'page_rewrite_rules', $page_rewrite);1517 $page_rewrite = apply_filters( 'page_rewrite_rules', $page_rewrite ); 1519 1518 1520 1519 // Extra permastructs 1521 1520 foreach ( $this->extra_permastructs as $permastructname => $permastruct ) { 1522 if ( is_array( $permastruct) )1523 $rules = $this->generate_rewrite_rules( $permastruct[0], $permastruct[1]);1521 if ( is_array( $permastruct ) ) 1522 $rules = $this->generate_rewrite_rules( $permastruct[0], $permastruct[1] ); 1524 1523 else 1525 $rules = $this->generate_rewrite_rules( $permastruct, EP_NONE);1524 $rules = $this->generate_rewrite_rules( $permastruct, EP_NONE ); 1526 1525 1527 $rules = apply_filters( $permastructname . '_rewrite_rules', $rules);1526 $rules = apply_filters( $permastructname . '_rewrite_rules', $rules ); 1528 1527 if ( 'post_tag' == $permastructname ) 1529 $rules = apply_filters( 'tag_rewrite_rules', $rules);1528 $rules = apply_filters( 'tag_rewrite_rules', $rules ); 1530 1529 1531 $this->extra_rules_top = array_merge( $this->extra_rules_top, $rules);1530 $this->extra_rules_top = array_merge( $this->extra_rules_top, $rules ); 1532 1531 } 1533 1532 1534 1533 // Put them together.