Changeset 2146
- Timestamp:
- 01/25/2005 12:23:57 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r2115 r2146 283 283 $where .= " AND post_name = '" . $q['name'] . "'"; 284 284 } else if ('' != $q['pagename']) { 285 $q['pagename'] = sanitize_title( $q['pagename']);285 $q['pagename'] = sanitize_title(basename($q['pagename'])); 286 286 $q['name'] = $q['pagename']; 287 287 $where .= " AND post_name = '" . $q['pagename'] . "'"; … … 822 822 823 823 $rewrite_rules = array(); 824 $page_structure = '/%pagename%'; 824 825 if( is_array( $uris ) ) 825 826 { 826 827 foreach ($uris as $uri => $pagename) { 827 $rewrite_rules += array($uri . '/?$' => "index.php?pagename=" . urldecode($pagename)); 828 $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename='); 829 $rewrite_rules += $this->generate_rewrite_rules($page_structure); 828 830 } 829 831 } … … 930 932 931 933 function add_rewrite_tag($tag, $pattern, $query) { 932 $this->rewritecode[] = $tag; 933 $this->rewritereplace[] = $pattern; 934 $this->queryreplace[] = $query; 934 // If the tag already exists, replace the existing pattern and query for 935 // that tag, otherwise add the new tag, pattern, and query to the end of 936 // the arrays. 937 $position = array_search($tag, $this->rewritecode); 938 if (FALSE !== $position && NULL !== $position) { 939 $this->rewritereplace[$position] = $pattern; 940 $this->queryreplace[$position] = $query; 941 } else { 942 $this->rewritecode[] = $tag; 943 $this->rewritereplace[] = $pattern; 944 $this->queryreplace[] = $query; 945 } 935 946 } 936 947 … … 1005 1016 $post = 0; 1006 1017 if (strstr($struct, '%postname%') || strstr($struct, '%post_id%') 1018 || strstr($struct, '%pagename%') 1007 1019 || (strstr($struct, '%year%') && strstr($struct, '%monthnum%') && strstr($struct, '%day%') && strstr($struct, '%hour%') && strstr($struct, '%minute') && strstr($struct, '%second%'))) { 1008 1020 $post = 1; -
trunk/wp-trackback.php
r2080 r2146 49 49 } 50 50 51 if ( is_single() )51 if ( is_single() || is_page() ) 52 52 $tb_id = $posts[0]->ID; 53 53
Note: See TracChangeset
for help on using the changeset viewer.