Make WordPress Core

Changeset 19736


Ignore:
Timestamp:
01/22/2012 05:21:29 PM (13 years ago)
Author:
duck_
Message:

Simplify code in WP_Rewrite::page_rewrite_rules() and remove out-of-date documenation. Fixes #19875.

File:
1 edited

Legend:

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

    r19712 r19736  
    808808     * Retrieve all of the rewrite rules for pages.
    809809     *
    810      * If the 'use_verbose_page_rules' property is false, then there will only
    811      * be a single rewrite rule for pages for those matching '%pagename%'. With
    812      * the property set to true, the attachments and the pages will be added for
    813      * each individual attachment URI and page URI, respectively.
    814      *
    815810     * @since 1.5.0
    816811     * @access public
     
    819814     */
    820815    function page_rewrite_rules() {
    821         $rewrite_rules = array();
    822         $page_structure = $this->get_page_permastruct();
    823 
    824816        // the extra .? at the beginning prevents clashes with other regular expressions in the rules array
    825         $this->add_rewrite_tag('%pagename%', "(.?.+?)", 'pagename=');
    826         $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES));
    827         return $rewrite_rules;
     817        $this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' );
     818
     819        return $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES );
    828820    }
    829821
Note: See TracChangeset for help on using the changeset viewer.