mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
a1f614654d
commit
a1d5fbaec2
@ -1822,13 +1822,7 @@ class WP_Rewrite {
|
|||||||
$this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false;
|
$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.
|
// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
|
||||||
$structure = ltrim($this->permalink_structure, '/');
|
if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $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%') )
|
|
||||||
$this->use_verbose_page_rules = true;
|
$this->use_verbose_page_rules = true;
|
||||||
else
|
else
|
||||||
$this->use_verbose_page_rules = false;
|
$this->use_verbose_page_rules = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user