Make WordPress Core

Ticket #7660: 7660.r8786.diff

File 7660.r8786.diff, 21.6 KB (added by jacobsantos, 18 years ago)

Incomplete skeleton patch based off of r8786

  • rewrite.php

     
    11<?php
     2/**
     3 * WordPress Rewrite API
     4 *
     5 * @package WordPress
     6 * @subpackage Rewrite
     7 */
    28
    3 /* WP_Rewrite API
    4 *******************************************************************************/
    5 
    6 //Add a straight rewrite rule
     9/**
     10 * add_rewrite_rule() - Add a straight rewrite rule
     11 *
     12 * {@internal Missing Long Description}}
     13 *
     14 * @since 2.1.0
     15 *
     16 * @param unknown_type $regex
     17 * @param unknown_type $redirect
     18 * @param unknown_type $after
     19 */
    720function add_rewrite_rule($regex, $redirect, $after = 'bottom') {
    821        global $wp_rewrite;
    922        $wp_rewrite->add_rule($regex, $redirect, $after);
    1023}
    1124
    12 //Add a new tag (like %postname%)
    13 //warning: you must call this on init or earlier, otherwise the query var addition stuff won't work
     25/**
     26 * add_rewrite_tag() - Add a new tag (like %postname%)
     27 *
     28 * Warning: you must call this on init or earlier, otherwise
     29 * the query var addition stuff won't work
     30 *
     31 * @since 2.1.0
     32 *
     33 * @param unknown_type $tagname
     34 * @param unknown_type $regex
     35 */
    1436function add_rewrite_tag($tagname, $regex) {
    1537        //validation
    1638        if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') {
     
    2446        $wp_rewrite->add_rewrite_tag($tagname, $regex, $qv . '=');
    2547}
    2648
    27 //Add a new feed type like /atom1/
     49/**
     50 * add_feed() - Add a new feed type like /atom1/
     51 *
     52 * {@internal Missing Long Description}}
     53 *
     54 * @since 2.1.0
     55 *
     56 * @param unknown_type $feedname
     57 * @param unknown_type $function
     58 * @return unknown
     59 */
    2860function add_feed($feedname, $function) {
    2961        global $wp_rewrite;
    3062        if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it is
     
    3769        return $hook;
    3870}
    3971
    40 define('EP_PERMALINK',  1   );
    41 define('EP_ATTACHMENT', 2   );
    42 define('EP_DATE',       4   );
    43 define('EP_YEAR',       8   );
    44 define('EP_MONTH',      16  );
    45 define('EP_DAY',        32  );
    46 define('EP_ROOT',       64  );
    47 define('EP_COMMENTS',   128 );
    48 define('EP_SEARCH',     256 );
    49 define('EP_CATEGORIES', 512 );
    50 define('EP_TAGS', 1024 );
    51 define('EP_AUTHORS',    2048);
    52 define('EP_PAGES',      4096);
     72/**
     73 * {@internal Missing Description}}
     74 *
     75 * @since 2.1.0
     76 */
     77define('EP_PERMALINK', 1);
     78
     79/**
     80 * {@internal Missing Description}}
     81 *
     82 * @since 2.1.0
     83 */
     84define('EP_ATTACHMENT', 2);
     85
     86/**
     87 * {@internal Missing Description}}
     88 *
     89 * @since 2.1.0
     90 */
     91define('EP_DATE', 4);
     92
     93/**
     94 * {@internal Missing Description}}
     95 *
     96 * @since 2.1.0
     97 */
     98define('EP_YEAR', 8);
     99
     100/**
     101 * {@internal Missing Description}}
     102 *
     103 * @since 2.1.0
     104 */
     105define('EP_MONTH', 16);
     106
     107/**
     108 * {@internal Missing Description}}
     109 *
     110 * @since 2.1.0
     111 */
     112define('EP_DAY', 32);
     113
     114/**
     115 * {@internal Missing Description}}
     116 *
     117 * @since 2.1.0
     118 */
     119define('EP_ROOT', 64);
     120
     121/**
     122 * {@internal Missing Description}}
     123 *
     124 * @since 2.1.0
     125 */
     126define('EP_COMMENTS', 128);
     127
     128/**
     129 * {@internal Missing Description}}
     130 *
     131 * @since 2.1.0
     132 */
     133define('EP_SEARCH', 256);
     134
     135/**
     136 * {@internal Missing Description}}
     137 *
     138 * @since 2.1.0
     139 */
     140define('EP_CATEGORIES', 512);
     141
     142/**
     143 * {@internal Missing Description}}
     144 *
     145 * @since 2.3.0
     146 */
     147define('EP_TAGS', 1024);
     148
     149/**
     150 * {@internal Missing Description}}
     151 *
     152 * @since 2.1.0
     153 */
     154define('EP_AUTHORS', 2048);
     155
     156/**
     157 * {@internal Missing Description}}
     158 *
     159 * @since 2.1.0
     160 */
     161define('EP_PAGES', 4096);
     162
    53163//pseudo-places
    54 define('EP_NONE',       0  );
    55 define('EP_ALL',        8191);
     164/**
     165 * {@internal Missing Description}}
     166 *
     167 * @since 2.1.0
     168 */
     169define('EP_NONE', 0);
    56170
    57 //and an endpoint, like /trackback/
     171/**
     172 * {@internal Missing Description}}
     173 *
     174 * @since 2.1.0
     175 */
     176define('EP_ALL', 8191);
     177
     178/**
     179 * add_rewrite_endpoint() - Add an endpoint, like /trackback/
     180 *
     181 * {@internal Missing Long Description}}
     182 *
     183 * @since 2.1.0
     184 *
     185 * @param unknown_type $name
     186 * @param unknown_type $places
     187 */
    58188function add_rewrite_endpoint($name, $places) {
    59189        global $wp_rewrite;
    60190        $wp_rewrite->add_endpoint($name, $places);
     
    76206
    77207// examine a url (supposedly from this blog) and try to
    78208// determine the post ID it represents.
     209/**
     210 * url_to_postid() - Examine a url and try to determine the post ID it represents
     211 *
     212 * {@internal Missing Long Description}}
     213 *
     214 * Checks are supposedly from the hosted site blog.
     215 *
     216 * @since 1.0.0
     217 *
     218 * @param unknown_type $url
     219 * @return unknown
     220 */
    79221function url_to_postid($url) {
    80222        global $wp_rewrite;
    81223
     
    172314        return 0;
    173315}
    174316
    175 /* WP_Rewrite class
    176 *******************************************************************************/
    177 
     317/**
     318 * {@internal Missing Short Description}}
     319 *
     320 * {@internal Missing Long Description}}
     321 *
     322 * @since 1.5.0
     323 */
    178324class WP_Rewrite {
     325        /**
     326         * {@internal Missing Description}}
     327         *
     328         * @since 1.5.0
     329         * @access private
     330         * @var unknown_type
     331         */
    179332        var $permalink_structure;
     333
     334        /**
     335         * {@internal Missing Description}}
     336         *
     337         * @since 2.2.0
     338         * @access private
     339         * @var bool
     340         */
    180341        var $use_trailing_slashes;
     342
     343        /**
     344         * {@internal Missing Description}}
     345         *
     346         * @since 1.5.0
     347         * @access private
     348         * @var unknown_type
     349         */
    181350        var $category_base;
     351
     352        /**
     353         * {@internal Missing Description}}
     354         *
     355         * @since 2.3.0
     356         * @access private
     357         * @var unknown_type
     358         */
    182359        var $tag_base;
     360
     361        /**
     362         * {@internal Missing Description}}
     363         *
     364         * @since 1.5.0
     365         * @access private
     366         * @var unknown_type
     367         */
    183368        var $category_structure;
     369
     370        /**
     371         * {@internal Missing Description}}
     372         *
     373         * @since 2.3.0
     374         * @access private
     375         * @var unknown_type
     376         */
    184377        var $tag_structure;
     378
     379        /**
     380         * {@internal Missing Description}}
     381         *
     382         * @since 1.5.0
     383         * @access private
     384         * @var string
     385         */
    185386        var $author_base = 'author';
     387
     388        /**
     389         * {@internal Missing Description}}
     390         *
     391         * @since 1.5.0
     392         * @access private
     393         * @var unknown_type
     394         */
    186395        var $author_structure;
     396
     397        /**
     398         * {@internal Missing Description}}
     399         *
     400         * @since 1.5.0
     401         * @access private
     402         * @var unknown_type
     403         */
    187404        var $date_structure;
     405
     406        /**
     407         * {@internal Missing Description}}
     408         *
     409         * @since 1.5.0
     410         * @access private
     411         * @var unknown_type
     412         */
    188413        var $page_structure;
     414
     415        /**
     416         * {@internal Missing Description}}
     417         *
     418         * @since 1.5.0
     419         * @access private
     420         * @var string
     421         */
    189422        var $search_base = 'search';
     423
     424        /**
     425         * {@internal Missing Description}}
     426         *
     427         * @since 1.5.0
     428         * @access private
     429         * @var unknown_type
     430         */
    190431        var $search_structure;
     432
     433        /**
     434         * {@internal Missing Description}}
     435         *
     436         * @since 1.5.0
     437         * @access private
     438         * @var string
     439         */
    191440        var $comments_base = 'comments';
     441
     442        /**
     443         * {@internal Missing Description}}
     444         *
     445         * @since 1.5.0
     446         * @access private
     447         * @var string
     448         */
    192449        var $feed_base = 'feed';
     450
     451        /**
     452         * {@internal Missing Description}}
     453         *
     454         * @since 1.5.0
     455         * @access private
     456         * @var string
     457         */
    193458        var $comments_feed_structure;
     459
     460        /**
     461         * {@internal Missing Description}}
     462         *
     463         * @since 1.5.0
     464         * @access private
     465         * @var string
     466         */
    194467        var $feed_structure;
     468
     469        /**
     470         * {@internal Missing Description}}
     471         *
     472         * @since 1.5.0
     473         * @access private
     474         * @var unknown_type
     475         */
    195476        var $front;
     477
     478        /**
     479         * {@internal Missing Description}}
     480         *
     481         * @since 1.5.0
     482         * @access
     483         * @var unknown_type
     484         */
    196485        var $root = '';
     486
     487        /**
     488         * {@internal Missing Description}}
     489         *
     490         * @since 1.5.0
     491         * @access public
     492         * @var string
     493         */
    197494        var $index = 'index.php';
     495
     496        /**
     497         * {@internal Missing Description}}
     498         *
     499         * @since 1.5.0
     500         * @access private
     501         * @var unknown_type
     502         */
    198503        var $matches = '';
     504
     505        /**
     506         * {@internal Missing Description}}
     507         *
     508         * @since 1.5.0
     509         * @access private
     510         * @var array
     511         */
    199512        var $rules;
    200         var $extra_rules = array(); //those not generated by the class, see add_rewrite_rule()
    201         var $extra_rules_top = array(); //those not generated by the class, see add_rewrite_rule()
    202         var $non_wp_rules = array(); //rules that don't redirect to WP's index.php
     513
     514        /**
     515         * {@internal Missing Description}}
     516         *
     517         * Those not generated by the class, see add_rewrite_rule()
     518         *
     519         * @since 2.1.0
     520         * @access private
     521         * @var array
     522         */
     523        var $extra_rules = array(); //
     524
     525        /**
     526         * {@internal Missing Description}}
     527         *
     528         * Those not generated by the class, see add_rewrite_rule()
     529         *
     530         * @since 2.3.0
     531         * @access private
     532         * @var array
     533         */
     534        var $extra_rules_top = array(); //
     535
     536        /**
     537         * Rules that don't redirect to WP's index.php
     538         *
     539         * @since 2.1.0
     540         * @access private
     541         * @var array
     542         */
     543        var $non_wp_rules = array(); //
     544
     545        /**
     546         * {@internal Missing Description}}
     547         *
     548         * @since 2.1.0
     549         * @access private
     550         * @var unknown_type
     551         */
    203552        var $extra_permastructs = array();
    204553        var $endpoints;
     554
     555        /**
     556         * {@internal Missing Description}}
     557         *
     558         * @since 2.0.0
     559         * @access public
     560         * @var bool
     561         */
    205562        var $use_verbose_rules = false;
     563
     564        /**
     565         * {@internal Missing Description}}
     566         *
     567         * @since 2.5.0
     568         * @access public
     569         * @var bool
     570         */
    206571        var $use_verbose_page_rules = true;
     572
     573        /**
     574         * {@internal Missing Description}}
     575         *
     576         * @since 1.5.0
     577         * @access private
     578         * @var array
     579         */
    207580        var $rewritecode =
    208581                array(
    209582                                        '%year%',
     
    221594                                        '%search%'
    222595                                        );
    223596
     597        /**
     598         * {@internal Missing Description}}
     599         *
     600         * @since 1.5.0
     601         * @access private
     602         * @var array
     603         */
    224604        var $rewritereplace =
    225605                array(
    226606                                        '([0-9]{4})',
     
    238618                                        '(.+)'
    239619                                        );
    240620
     621        /**
     622         * {@internal Missing Description}}
     623         *
     624         * @since 1.5.0
     625         * @access private
     626         * @var array
     627         */
    241628        var $queryreplace =
    242629                array (
    243630                                        'year=',
     
    255642                                        's='
    256643                                        );
    257644
     645        /**
     646         * {@internal Missing Description}}
     647         *
     648         * @since 1.5.0
     649         * @access private
     650         * @var array
     651         */
    258652        var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
    259653
     654        /**
     655         * {@internal Missing Short Description}}
     656         *
     657         * {@internal Missing Long Description}}
     658         *
     659         * @since 1.5.0
     660         * @access public
     661         *
     662         * @return unknown
     663         */
    260664        function using_permalinks() {
    261665                if (empty($this->permalink_structure))
    262666                        return false;
     
    264668                        return true;
    265669        }
    266670
     671        /**
     672         * {@internal Missing Short Description}}
     673         *
     674         * {@internal Missing Long Description}}
     675         *
     676         * @since 1.5.0
     677         * @access public
     678         *
     679         * @return unknown
     680         */
    267681        function using_index_permalinks() {
    268682                if (empty($this->permalink_structure)) {
    269683                        return false;
     
    277691                return false;
    278692        }
    279693
     694        /**
     695         * {@internal Missing Short Description}}
     696         *
     697         * {@internal Missing Long Description}}
     698         *
     699         * @since 1.5.0
     700         * @access public
     701         *
     702         * @return unknown
     703         */
    280704        function using_mod_rewrite_permalinks() {
    281705                if ( $this->using_permalinks() && ! $this->using_index_permalinks())
    282706                        return true;
     
    284708                        return false;
    285709        }
    286710
     711        /**
     712         * {@internal Missing Short Description}}
     713         *
     714         * {@internal Missing Long Description}}
     715         *
     716         * @since 1.5.0
     717         * @access public
     718         *
     719         * @param unknown_type $number
     720         * @return unknown
     721         */
    287722        function preg_index($number) {
    288723                $match_prefix = '$';
    289724                $match_suffix = '';
     
    296731                return "$match_prefix$number$match_suffix";
    297732        }
    298733
     734        /**
     735         * {@internal Missing Short Description}}
     736         *
     737         * {@internal Missing Long Description}}
     738         *
     739         * @since 2.5.0
     740         * @access public
     741         *
     742         * @return unknown
     743         */
    299744        function page_uri_index() {
    300745                global $wpdb;
    301746
     
    328773                return array( $page_uris, $page_attachment_uris );
    329774        }
    330775
     776        /**
     777         * {@internal Missing Short Description}}
     778         *
     779         * {@internal Missing Long Description}}
     780         *
     781         * @since 1.5.0
     782         * @access public
     783         *
     784         * @return unknown
     785         */
    331786        function page_rewrite_rules() {
    332787                $rewrite_rules = array();
    333788                $page_structure = $this->get_page_permastruct();
     
    359814                return $rewrite_rules;
    360815        }
    361816
     817        /**
     818         * {@internal Missing Short Description}}
     819         *
     820         * {@internal Missing Long Description}}
     821         *
     822         * @since 1.5.0
     823         * @access public
     824         *
     825         * @return unknown
     826         */
    362827        function get_date_permastruct() {
    363828                if (isset($this->date_structure)) {
    364829                        return $this->date_structure;
     
    403868                return $this->date_structure;
    404869        }
    405870
     871        /**
     872         * {@internal Missing Short Description}}
     873         *
     874         * {@internal Missing Long Description}}
     875         *
     876         * @since 1.5.0
     877         * @access public
     878         *
     879         * @return unknown
     880         */
    406881        function get_year_permastruct() {
    407882                $structure = $this->get_date_permastruct($this->permalink_structure);
    408883
     
    418893                return $structure;
    419894        }
    420895
     896        /**
     897         * {@internal Missing Short Description}}
     898         *
     899         * {@internal Missing Long Description}}
     900         *
     901         * @since 1.5.0
     902         * @access public
     903         *
     904         * @return unknown
     905         */
    421906        function get_month_permastruct() {
    422907                $structure = $this->get_date_permastruct($this->permalink_structure);
    423908
     
    432917                return $structure;
    433918        }
    434919
     920        /**
     921         * {@internal Missing Short Description}}
     922         *
     923         * {@internal Missing Long Description}}
     924         *
     925         * @since 1.5.0
     926         * @access public
     927         *
     928         * @return unknown
     929         */
    435930        function get_day_permastruct() {
    436931                return $this->get_date_permastruct($this->permalink_structure);
    437932        }
    438933
     934        /**
     935         * {@internal Missing Short Description}}
     936         *
     937         * {@internal Missing Long Description}}
     938         *
     939         * @since 1.5.0
     940         * @access public
     941         *
     942         * @return unknown
     943         */
    439944        function get_category_permastruct() {
    440945                if (isset($this->category_structure)) {
    441946                        return $this->category_structure;
     
    456961                return $this->category_structure;
    457962        }
    458963
     964        /**
     965         * {@internal Missing Short Description}}
     966         *
     967         * {@internal Missing Long Description}}
     968         *
     969         * @since 2.3.0
     970         * @access public
     971         *
     972         * @return unknown
     973         */
    459974        function get_tag_permastruct() {
    460975                if (isset($this->tag_structure)) {
    461976                        return $this->tag_structure;
     
    482997                return false;
    483998        }
    484999
     1000        /**
     1001         * {@internal Missing Short Description}}
     1002         *
     1003         * {@internal Missing Long Description}}
     1004         *
     1005         * @since 1.5.0
     1006         * @access public
     1007         *
     1008         * @return unknown
     1009         */
    4851010        function get_author_permastruct() {
    4861011                if (isset($this->author_structure)) {
    4871012                        return $this->author_structure;
     
    4971022                return $this->author_structure;
    4981023        }
    4991024
     1025        /**
     1026         * {@internal Missing Short Description}}
     1027         *
     1028         * {@internal Missing Long Description}}
     1029         *
     1030         * @since 1.5.0
     1031         * @access public
     1032         *
     1033         * @return unknown
     1034         */
    5001035        function get_search_permastruct() {
    5011036                if (isset($this->search_structure)) {
    5021037                        return $this->search_structure;
     
    5121047                return $this->search_structure;
    5131048        }
    5141049
     1050        /**
     1051         * {@internal Missing Short Description}}
     1052         *
     1053         * {@internal Missing Long Description}}
     1054         *
     1055         * @since 1.5.0
     1056         * @access public
     1057         *
     1058         * @return unknown
     1059         */
    5151060        function get_page_permastruct() {
    5161061                if (isset($this->page_structure)) {
    5171062                        return $this->page_structure;
     
    5271072                return $this->page_structure;
    5281073        }
    5291074
     1075        /**
     1076         * {@internal Missing Short Description}}
     1077         *
     1078         * {@internal Missing Long Description}}
     1079         *
     1080         * @since 1.5.0
     1081         * @access public
     1082         *
     1083         * @return unknown
     1084         */
    5301085        function get_feed_permastruct() {
    5311086                if (isset($this->feed_structure)) {
    5321087                        return $this->feed_structure;
     
    5421097                return $this->feed_structure;
    5431098        }
    5441099
     1100        /**
     1101         * {@internal Missing Short Description}}
     1102         *
     1103         * {@internal Missing Long Description}}
     1104         *
     1105         * @since 1.5.0
     1106         * @access public
     1107         *
     1108         * @return unknown
     1109         */
    5451110        function get_comment_feed_permastruct() {
    5461111                if (isset($this->comment_feed_structure)) {
    5471112                        return $this->comment_feed_structure;
     
    5571122                return $this->comment_feed_structure;
    5581123        }
    5591124
     1125        /**
     1126         * {@internal Missing Short Description}}
     1127         *
     1128         * {@internal Missing Long Description}}
     1129         *
     1130         * @since 1.5.0
     1131         * @access public
     1132         *
     1133         * @param unknown_type $tag
     1134         * @param unknown_type $pattern
     1135         * @param unknown_type $query
     1136         */
    5601137        function add_rewrite_tag($tag, $pattern, $query) {
    5611138                // If the tag already exists, replace the existing pattern and query for
    5621139                // that tag, otherwise add the new tag, pattern, and query to the end of
     
    5721149                }
    5731150        }
    5741151
    575         //the main WP_Rewrite function. generate the rules from permalink structure
     1152        /**
     1153         * Generate the rules from permalink structure
     1154         *
     1155         * {@internal Missing Long Description}}
     1156         *
     1157         * The main WP_Rewrite function.
     1158         *
     1159         * @since 1.5.0
     1160         * @access public
     1161         *
     1162         * @param unknown_type $permalink_structure
     1163         * @param unknown_type $ep_mask
     1164         * @param unknown_type $paged
     1165         * @param unknown_type $feed
     1166         * @param unknown_type $forcomments
     1167         * @param unknown_type $walk_dirs
     1168         * @param unknown_type $endpoints
     1169         * @return unknown
     1170         */
    5761171        function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
    5771172                //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
    5781173                $feedregex2 = '';
     
    7891384                return $post_rewrite; //the finished rules. phew!
    7901385        }
    7911386
     1387        /**
     1388         * {@internal Missing Short Description}}
     1389         *
     1390         * {@internal Missing Long Description}}
     1391         *
     1392         * @since 1.5.0
     1393         * @access public
     1394         *
     1395         * @param unknown_type $permalink_structure
     1396         * @param unknown_type $walk_dirs
     1397         * @return unknown
     1398         */
    7921399        function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
    7931400                return $this->generate_rewrite_rules($permalink_structure, EP_NONE, false, false, false, $walk_dirs);
    7941401        }
    7951402
    796         /* rewrite_rules
    797          * Construct rewrite matches and queries from permalink structure.
    798          * Returns an associate array of matches and queries.
     1403        /**
     1404         * Construct rewrite matches and queries from permalink structure
     1405         *
     1406         * {@internal Missing Long Description}}
     1407         *
     1408         * @since 1.5.0
     1409         * @access public
     1410         *
     1411         * @return array an associate array of matches and queries
    7991412         */
    8001413        function rewrite_rules() {
    8011414                $rewrite = array();
     
    8681481                return $this->rules;
    8691482        }
    8701483
     1484        /**
     1485         * {@internal Missing Short Description}}
     1486         *
     1487         * {@internal Missing Long Description}}
     1488         *
     1489         * @since 1.5.0
     1490         * @access public
     1491         *
     1492         * @return unknown
     1493         */
    8711494        function wp_rewrite_rules() {
    8721495                $this->rules = get_option('rewrite_rules');
    8731496                if ( empty($this->rules) ) {
     
    8791502                return $this->rules;
    8801503        }
    8811504
     1505        /**
     1506         * {@internal Missing Short Description}}
     1507         *
     1508         * {@internal Missing Long Description}}
     1509         *
     1510         * @since 1.5.0
     1511         * @access public
     1512         *
     1513         * @return unknown
     1514         */
    8821515        function mod_rewrite_rules() {
    8831516                if ( ! $this->using_permalinks()) {
    8841517                        return '';
     
    9461579                return $rules;
    9471580        }
    9481581
    949         //Add a straight rewrite rule
     1582        /**
     1583         * Add a straight rewrite rule
     1584         *
     1585         * {@internal Missing Long Description}}
     1586         *
     1587         * @since 2.1.0
     1588         * @access public
     1589         *
     1590         * @param unknown_type $regex
     1591         * @param unknown_type $redirect
     1592         * @param unknown_type $after
     1593         */
    9501594        function add_rule($regex, $redirect, $after = 'bottom') {
    9511595                //get everything up to the first ?
    9521596                $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?'));
     
    9621606                }
    9631607        }
    9641608
    965         //add a rule that doesn't redirect to index.php
     1609        /**
     1610         * Add a rule that doesn't redirect to index.php
     1611         *
     1612         * {@internal Missing Long Description}}
     1613         *
     1614         * @since 2.1.0
     1615         * @access public
     1616         *
     1617         * @param unknown_type $regex
     1618         * @param unknown_type $redirect
     1619         */
    9661620        function add_external_rule($regex, $redirect) {
    9671621                $this->non_wp_rules[$regex] = $redirect;
    9681622        }
    9691623
    970         //add an endpoint, like /trackback/, to be inserted after certain URL types (specified in $places)
     1624        /**
     1625         * Add an endpoint, like /trackback/
     1626         *
     1627         * {@internal Missing Long Description}}
     1628         *
     1629         * To be inserted after certain URL types (specified in $places)
     1630         *
     1631         * @since 2.1.0
     1632         * @access public
     1633         *
     1634         * @param unknown_type $name
     1635         * @param unknown_type $places
     1636         */
    9711637        function add_endpoint($name, $places) {
    9721638                global $wp;
    9731639                $this->endpoints[] = array ( $places, $name );
     
    9801646                $this->extra_permastructs[$name] = $struct;
    9811647        }
    9821648
     1649        /**
     1650         * {@internal Missing Short Description}}
     1651         *
     1652         * {@internal Missing Long Description}}
     1653         *
     1654         * @since 2.0.1
     1655         * @access public
     1656         */
    9831657        function flush_rules() {
    9841658                delete_option('rewrite_rules');
    9851659                $this->wp_rewrite_rules();
     
    9871661                        save_mod_rewrite_rules();
    9881662        }
    9891663
     1664        /**
     1665         * {@internal Missing Short Description}}
     1666         *
     1667         * {@internal Missing Long Description}}
     1668         *
     1669         * @since 1.5.0
     1670         * @access public
     1671         */
    9901672        function init() {
    9911673                $this->extra_rules = $this->non_wp_rules = $this->endpoints = array();
    9921674                $this->permalink_structure = get_option('permalink_structure');
     
    10191701                        $this->use_verbose_page_rules = false;
    10201702        }
    10211703
     1704        /**
     1705         * {@internal Missing Short Description}}
     1706         *
     1707         * {@internal Missing Long Description}}
     1708         *
     1709         * @since 1.5.0
     1710         * @access public
     1711         *
     1712         * @param unknown_type $permalink_structure
     1713         */
    10221714        function set_permalink_structure($permalink_structure) {
    10231715                if ($permalink_structure != $this->permalink_structure) {
    10241716                        update_option('permalink_structure', $permalink_structure);
     
    10261718                }
    10271719        }
    10281720
     1721        /**
     1722         * {@internal Missing Short Description}}
     1723         *
     1724         * {@internal Missing Long Description}}
     1725         *
     1726         * @since 1.5.0
     1727         * @access public
     1728         *
     1729         * @param unknown_type $category_base
     1730         */
    10291731        function set_category_base($category_base) {
    10301732                if ($category_base != $this->category_base) {
    10311733                        update_option('category_base', $category_base);
     
    10331735                }
    10341736        }
    10351737
     1738        /**
     1739         * {@internal Missing Short Description}}
     1740         *
     1741         * {@internal Missing Long Description}}
     1742         *
     1743         * @since 2.3.0
     1744         * @access public
     1745         *
     1746         * @param unknown_type $tag_base
     1747         */
    10361748        function set_tag_base( $tag_base ) {
    10371749                if ( $tag_base != $this->tag_base ) {
    10381750                        update_option( 'tag_base', $tag_base );
     
    10401752                }
    10411753        }
    10421754
     1755        /**
     1756         * {@internal Missing Short Description}}
     1757         *
     1758         * {@internal Missing Long Description}}
     1759         *
     1760         * @since 1.5.0
     1761         * @access public
     1762         *
     1763         * @return WP_Rewrite
     1764         */
    10431765        function WP_Rewrite() {
    10441766                $this->init();
    10451767        }