Changeset 34903 for trunk/src/wp-includes/class-wp-rewrite.php
- Timestamp:
- 10/07/2015 10:35:18 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-rewrite.php
r34708 r34903 862 862 $pageregex = $this->pagination_base . '/?([0-9]{1,})/?$'; 863 863 $commentregex = $this->comments_pagination_base . '-([0-9]{1,})/?$'; 864 $embedregex = 'embed/?$'; 864 865 865 866 //build up an array of endpoint regexes to append => queries to append … … 885 886 $feedindex = $index; 886 887 $trackbackindex = $index; 888 $embedindex = $index; 889 887 890 //build a list from the rewritecode and queryreplace arrays, that will look something like 888 891 //tagname=$matches[i] where i is the current $i … … 1030 1033 $trackbackmatch = $match . $trackbackregex; 1031 1034 $trackbackquery = $trackbackindex . '?' . $query . '&tb=1'; 1035 1036 // Create query and regex for embeds. 1037 $embedmatch = $match . $embedregex; 1038 $embedquery = $embedindex . '?' . $query . '&embed=true'; 1039 1032 1040 //trim slashes from the end of the regex for this dir 1033 1041 $match = rtrim($match, '/'); 1042 1034 1043 //get rid of brackets 1035 1044 $submatchbase = str_replace( array('(', ')'), '', $match); … … 1041 1050 $sub1feed2 = $sub1 . $feedregex2; //and <permalink>/(feed|atom...) 1042 1051 $sub1comment = $sub1 . $commentregex; //and <permalink>/comment-page-xx 1052 $sub1embed = $sub1 . $embedregex; //and <permalink>/embed/... 1043 1053 1044 1054 //add another rule to match attachments in the explicit form: … … 1049 1059 $sub2feed2 = $sub2 . $feedregex2; //and feeds again on to this <permalink>/attachment/(feed|atom...) 1050 1060 $sub2comment = $sub2 . $commentregex; //and <permalink>/comment-page-xx 1061 $sub2embed = $sub2 . $embedregex; //and <permalink>/embed/... 1051 1062 1052 1063 //create queries for these extra tag-ons we've just dealt with … … 1055 1066 $subfeedquery = $subquery . '&feed=' . $this->preg_index(2); 1056 1067 $subcommentquery = $subquery . '&cpage=' . $this->preg_index(2); 1068 $subembedquery = $subquery . '&embed=true'; 1057 1069 1058 1070 //do endpoints for attachments … … 1093 1105 $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite); 1094 1106 1107 // add embed 1108 $rewrite = array_merge( array( $embedmatch => $embedquery ), $rewrite ); 1109 1095 1110 //add regexes/queries for attachments, attachment trackbacks and so on 1096 if ( ! $page ) //require <permalink>/attachment/stuff form for pages because of confusion with subpages 1097 $rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery, $sub1comment => $subcommentquery)); 1098 $rewrite = array_merge(array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery, $sub2comment => $subcommentquery), $rewrite); 1111 if ( ! $page ) { 1112 //require <permalink>/attachment/stuff form for pages because of confusion with subpages 1113 $rewrite = array_merge( $rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery, $sub1comment => $subcommentquery, $sub1embed => $subembedquery ) ); 1114 } 1115 1116 $rewrite = array_merge( array( $sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery, $sub2comment => $subcommentquery, $sub2embed => $subembedquery ), $rewrite ); 1099 1117 } 1100 1118 } //if($num_toks)
Note: See TracChangeset
for help on using the changeset viewer.