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: http://svn.automattic.com/wordpress/trunk@11335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-14 21:50:20 +00:00
parent a1f614654d
commit a1d5fbaec2

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;