Make WordPress Core

Changeset 34958


Ignore:
Timestamp:
10/08/2015 09:23:31 PM (11 years ago)
Author:
DrewAPicture
Message:

Docs: Improve more formatting and syntax for inline comments in WP_Rewrite.

See #34218.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-rewrite.php

    r34957 r34958  
    12431243                $robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array();
    12441244
    1245                 // Old feed and service files
     1245                // Old feed and service files.
    12461246                $deprecated_files = array(
    12471247                        '.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old',
     
    12491249                );
    12501250
    1251                 // Registration rules
     1251                // Registration rules.
    12521252                $registration_pages = array();
    12531253                if ( is_multisite() && is_main_site() ) {
     
    12551255                        $registration_pages['.*wp-activate.php$'] = $this->index . '?activate=true';
    12561256                }
    1257                 $registration_pages['.*wp-register.php$'] = $this->index . '?register=true'; // Deprecated
     1257
     1258                // Deprecated.
     1259                $registration_pages['.*wp-register.php$'] = $this->index . '?register=true';
    12581260
    12591261                // Post rewrite rules.
     
    14761478                $rules .= "RewriteEngine On\n";
    14771479                $rules .= "RewriteBase $home_root\n";
    1478                 $rules .= "RewriteRule ^index\.php$ - [L]\n"; // Prevent -f checks on index.php.
    1479 
    1480                 //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all)
     1480
     1481                // Prevent -f checks on index.php.
     1482                $rules .= "RewriteRule ^index\.php$ - [L]\n";
     1483
     1484                // Add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all).
    14811485                foreach ( (array) $this->non_wp_rules as $match => $query) {
    14821486                        // Apache 1.3 does not support the reluctant (non-greedy) modifier.
    14831487                        $match = str_replace('.+?', '.+', $match);
    1484 
    1485                         // If the match is unanchored and greedy, prepend rewrite conditions
    1486                         // to avoid infinite redirects and eclipsing of real files.
    1487                         //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
    1488                                 //nada.
    1489                         //}
    14901488
    14911489                        $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
     
    15031501                                // Apache 1.3 does not support the reluctant (non-greedy) modifier.
    15041502                                $match = str_replace('.+?', '.+', $match);
    1505 
    1506                                 // If the match is unanchored and greedy, prepend rewrite conditions
    1507                                 // to avoid infinite redirects and eclipsing of real files.
    1508                                 //if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
    1509                                         //nada.
    1510                                 //}
    15111503
    15121504                                if ( strpos($query, $this->index) !== false )
     
    15241516
    15251517                /**
    1526                  *
    15271518                 * Filter the list of rewrite rules formatted for output to an .htaccess file.
    15281519                 *
     
    16201611                }
    16211612
    1622                 // "external" = it doesn't correspond to index.php
     1613                // "external" = it doesn't correspond to index.php.
    16231614                if ( $external ) {
    16241615                        $this->add_external_rule( $regex, $query );
     
    16651656                global $wp;
    16661657
    1667                 // For backward compatibility, if `null` has explicitly been passed as `$query_var`, assume `true`.
     1658                // For backward compatibility, if null has explicitly been passed as `$query_var`, assume `true`.
    16681659                if ( true === $query_var || null === func_get_arg( 2 ) ) {
    16691660                        $query_var = $name;
     
    17051696         */
    17061697        public function add_permastruct( $name, $struct, $args = array() ) {
    1707                 // backwards compatibility for the old parameters: $with_front and $ep_mask
     1698                // Backwards compatibility for the old parameters: $with_front and $ep_mask.
    17081699                if ( ! is_array( $args ) )
    17091700                        $args = array( 'with_front' => $args );
     
    17481739                static $do_hard_later = null;
    17491740
    1750                 // Prevent this action from running before everyone has registered their rewrites
     1741                // Prevent this action from running before everyone has registered their rewrites.
    17511742                if ( ! did_action( 'wp_loaded' ) ) {
    17521743                        add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
     
    17621753                delete_option('rewrite_rules');
    17631754                $this->wp_rewrite_rules();
     1755
    17641756                /**
    17651757                 * Filter whether a "hard" rewrite rule flush should be performed when requested.
Note: See TracChangeset for help on using the changeset viewer.