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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-01-22 17:21:29 +00:00
parent d23f8fcb48
commit 15cd5752b2
1 changed files with 3 additions and 11 deletions

View File

@ -807,24 +807,16 @@ class WP_Rewrite {
/** /**
* Retrieve all of the rewrite rules for pages. * Retrieve all of the rewrite rules for pages.
* *
* If the 'use_verbose_page_rules' property is false, then there will only
* be a single rewrite rule for pages for those matching '%pagename%'. With
* the property set to true, the attachments and the pages will be added for
* each individual attachment URI and page URI, respectively.
*
* @since 1.5.0 * @since 1.5.0
* @access public * @access public
* *
* @return array * @return array
*/ */
function page_rewrite_rules() { function page_rewrite_rules() {
$rewrite_rules = array();
$page_structure = $this->get_page_permastruct();
// the extra .? at the beginning prevents clashes with other regular expressions in the rules array // the extra .? at the beginning prevents clashes with other regular expressions in the rules array
$this->add_rewrite_tag('%pagename%', "(.?.+?)", 'pagename='); $this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' );
$rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES));
return $rewrite_rules; return $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES );
} }
/** /**