Better verbose page rule detection to support showing posts on a page with a custom permastruct. Props Denis-de-Bernardy. fixes #6603

git-svn-id: https://develop.svn.wordpress.org/trunk@11335 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-14 21:50:20 +00:00
parent d892f1f557
commit 701d5f8bad
1 changed files with 1 additions and 7 deletions

View File

@ -1822,13 +1822,7 @@ class WP_Rewrite {
$this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false;
// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
$structure = ltrim($this->permalink_structure, '/');
if ( $this->using_index_permalinks() )
$structure = ltrim($this->permalink_structure, $this->index . '/');
if ( 0 === strpos($structure, '%postname%') ||
0 === strpos($structure, '%category%') ||
0 === strpos($structure, '%tag%') ||
0 === strpos($structure, '%author%') )
if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) )
$this->use_verbose_page_rules = true;
else
$this->use_verbose_page_rules = false;