From 701d5f8badb792db35ad669e377084c060109daa Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 14 May 2009 21:50:20 +0000 Subject: [PATCH] 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 --- wp-includes/rewrite.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index fe5b4ad47a..f1b4b79d0e 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -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;