Changeset 28533 for trunk/src/wp-includes/rewrite.php
- Timestamp:
- 05/19/2014 05:40:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rewrite.php
r28014 r28533 572 572 * @var string 573 573 */ 574 var$index = 'index.php';574 public $index = 'index.php'; 575 575 576 576 /** … … 655 655 * @var bool 656 656 */ 657 var$use_verbose_rules = false;657 public $use_verbose_rules = false; 658 658 659 659 /** … … 673 673 * @var bool 674 674 */ 675 var$use_verbose_page_rules = true;675 public $use_verbose_page_rules = true; 676 676 677 677 /** … … 764 764 * @return bool True, if permalinks are enabled. 765 765 */ 766 function using_permalinks() {766 public function using_permalinks() { 767 767 return ! empty($this->permalink_structure); 768 768 } … … 778 778 * @return bool 779 779 */ 780 function using_index_permalinks() {780 public function using_index_permalinks() { 781 781 if ( empty($this->permalink_structure) ) 782 782 return false; … … 799 799 * @return bool 800 800 */ 801 function using_mod_rewrite_permalinks() {801 public function using_mod_rewrite_permalinks() { 802 802 if ( $this->using_permalinks() && ! $this->using_index_permalinks() ) 803 803 return true; … … 822 822 * @return string 823 823 */ 824 function preg_index($number) {824 public function preg_index($number) { 825 825 $match_prefix = '$'; 826 826 $match_suffix = ''; … … 845 845 * @return array Array of page URIs as first element and attachment URIs as second element. 846 846 */ 847 function page_uri_index() {847 public function page_uri_index() { 848 848 global $wpdb; 849 849 … … 887 887 * @return array 888 888 */ 889 function page_rewrite_rules() {889 public function page_rewrite_rules() { 890 890 // the extra .? at the beginning prevents clashes with other regular expressions in the rules array 891 891 $this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' ); … … 914 914 * @return bool|string False on no permalink structure. Date permalink structure. 915 915 */ 916 function get_date_permastruct() {916 public function get_date_permastruct() { 917 917 if ( isset($this->date_structure) ) 918 918 return $this->date_structure; … … 968 968 * @return bool|string False on failure. Year structure on success. 969 969 */ 970 function get_year_permastruct() {970 public function get_year_permastruct() { 971 971 $structure = $this->get_date_permastruct(); 972 972 … … 993 993 * @return bool|string False on failure. Year/Month structure on success. 994 994 */ 995 function get_month_permastruct() {995 public function get_month_permastruct() { 996 996 $structure = $this->get_date_permastruct(); 997 997 … … 1016 1016 * @return bool|string False on failure. Year/Month/Day structure on success. 1017 1017 */ 1018 function get_day_permastruct() {1018 public function get_day_permastruct() { 1019 1019 return $this->get_date_permastruct(); 1020 1020 } … … 1033 1033 * @return bool|string False on failure. Category permalink structure. 1034 1034 */ 1035 function get_category_permastruct() {1035 public function get_category_permastruct() { 1036 1036 return $this->get_extra_permastruct('category'); 1037 1037 } … … 1050 1050 * @return bool|string False on failure. Tag permalink structure. 1051 1051 */ 1052 function get_tag_permastruct() {1052 public function get_tag_permastruct() { 1053 1053 return $this->get_extra_permastruct('post_tag'); 1054 1054 } … … 1063 1063 * @return string|bool False if not found. Permalink structure string. 1064 1064 */ 1065 function get_extra_permastruct($name) {1065 public function get_extra_permastruct($name) { 1066 1066 if ( empty($this->permalink_structure) ) 1067 1067 return false; … … 1085 1085 * @return string|bool False if not found. Permalink structure string. 1086 1086 */ 1087 function get_author_permastruct() {1087 public function get_author_permastruct() { 1088 1088 if ( isset($this->author_structure) ) 1089 1089 return $this->author_structure; … … 1111 1111 * @return string|bool False if not found. Permalink structure string. 1112 1112 */ 1113 function get_search_permastruct() {1113 public function get_search_permastruct() { 1114 1114 if ( isset($this->search_structure) ) 1115 1115 return $this->search_structure; … … 1137 1137 * @return string|bool False if not found. Permalink structure string. 1138 1138 */ 1139 function get_page_permastruct() {1139 public function get_page_permastruct() { 1140 1140 if ( isset($this->page_structure) ) 1141 1141 return $this->page_structure; … … 1163 1163 * @return string|bool False if not found. Permalink structure string. 1164 1164 */ 1165 function get_feed_permastruct() {1165 public function get_feed_permastruct() { 1166 1166 if ( isset($this->feed_structure) ) 1167 1167 return $this->feed_structure; … … 1189 1189 * @return string|bool False if not found. Permalink structure string. 1190 1190 */ 1191 function get_comment_feed_permastruct() {1191 public function get_comment_feed_permastruct() { 1192 1192 if ( isset($this->comment_feed_structure) ) 1193 1193 return $this->comment_feed_structure; … … 1219 1219 * @param string $query String to append to the rewritten query. Must end in '='. 1220 1220 */ 1221 function add_rewrite_tag( $tag, $regex, $query ) {1221 public function add_rewrite_tag( $tag, $regex, $query ) { 1222 1222 $position = array_search( $tag, $this->rewritecode ); 1223 1223 if ( false !== $position && null !== $position ) { … … 1251 1251 * @return array Rewrite rule list. 1252 1252 */ 1253 function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {1253 public function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) { 1254 1254 //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/? 1255 1255 $feedregex2 = ''; … … 1521 1521 * @return array 1522 1522 */ 1523 function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {1523 public function generate_rewrite_rule($permalink_structure, $walk_dirs = false) { 1524 1524 return $this->generate_rewrite_rules($permalink_structure, EP_NONE, false, false, false, $walk_dirs); 1525 1525 } … … 1543 1543 * @return array An associate array of matches and queries. 1544 1544 */ 1545 function rewrite_rules() {1545 public function rewrite_rules() { 1546 1546 $rewrite = array(); 1547 1547 … … 1745 1745 * @return array Rewrite rules. 1746 1746 */ 1747 function wp_rewrite_rules() {1747 public function wp_rewrite_rules() { 1748 1748 $this->rules = get_option('rewrite_rules'); 1749 1749 if ( empty($this->rules) ) { … … 1770 1770 * @return string 1771 1771 */ 1772 function mod_rewrite_rules() {1772 public function mod_rewrite_rules() { 1773 1773 if ( ! $this->using_permalinks() ) 1774 1774 return ''; … … 1868 1868 * @return string 1869 1869 */ 1870 function iis7_url_rewrite_rules( $add_parent_tags = false ) {1870 public function iis7_url_rewrite_rules( $add_parent_tags = false ) { 1871 1871 1872 1872 if ( ! $this->using_permalinks() ) … … 1923 1923 * @param string $after Optional, default is bottom. Location to place rule. 1924 1924 */ 1925 function add_rule($regex, $redirect, $after = 'bottom') {1925 public function add_rule($regex, $redirect, $after = 'bottom') { 1926 1926 //get everything up to the first ? 1927 1927 $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?')); … … 1949 1949 * @param string $redirect URL regex redirects to when regex matches request. 1950 1950 */ 1951 function add_external_rule($regex, $redirect) {1951 public function add_external_rule($regex, $redirect) { 1952 1952 $this->non_wp_rules[$regex] = $redirect; 1953 1953 } … … 1967 1967 * @param string $query_var Name of the corresponding query variable. Default is value of $name. 1968 1968 */ 1969 function add_endpoint( $name, $places, $query_var = null ) {1969 public function add_endpoint( $name, $places, $query_var = null ) { 1970 1970 global $wp; 1971 1971 if ( null === $query_var ) { … … 2004 2004 * - endpoints (bool) - Should endpoints be applied to the generated rewrite rules? Default is true. 2005 2005 */ 2006 function add_permastruct( $name, $struct, $args = array() ) {2006 public function add_permastruct( $name, $struct, $args = array() ) { 2007 2007 // backwards compatibility for the old parameters: $with_front and $ep_mask 2008 2008 if ( ! is_array( $args ) ) … … 2043 2043 * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). 2044 2044 */ 2045 function flush_rules($hard = true) {2045 public function flush_rules($hard = true) { 2046 2046 delete_option('rewrite_rules'); 2047 2047 $this->wp_rewrite_rules(); … … 2074 2074 * @access public 2075 2075 */ 2076 function init() {2076 public function init() { 2077 2077 $this->extra_rules = $this->non_wp_rules = $this->endpoints = array(); 2078 2078 $this->permalink_structure = get_option('permalink_structure'); … … 2111 2111 * @param string $permalink_structure Permalink structure. 2112 2112 */ 2113 function set_permalink_structure($permalink_structure) {2113 public function set_permalink_structure($permalink_structure) { 2114 2114 if ( $permalink_structure != $this->permalink_structure ) { 2115 2115 $old_permalink_structure = $this->permalink_structure; … … 2141 2141 * @param string $category_base Category permalink structure base. 2142 2142 */ 2143 function set_category_base($category_base) {2143 public function set_category_base($category_base) { 2144 2144 if ( $category_base != get_option('category_base') ) { 2145 2145 update_option('category_base', $category_base); … … 2160 2160 * @param string $tag_base Tag permalink structure base. 2161 2161 */ 2162 function set_tag_base( $tag_base ) {2162 public function set_tag_base( $tag_base ) { 2163 2163 if ( $tag_base != get_option( 'tag_base') ) { 2164 2164 update_option( 'tag_base', $tag_base ); … … 2175 2175 * @return WP_Rewrite 2176 2176 */ 2177 function __construct() {2177 public function __construct() { 2178 2178 $this->init(); 2179 2179 }
Note: See TracChangeset
for help on using the changeset viewer.