Make WordPress Core

Changeset 11335


Ignore:
Timestamp:
05/14/2009 09:50:20 PM (15 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/rewrite.php

    r11325 r11335  
    18231823
    18241824        // Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
    1825         $structure = ltrim($this->permalink_structure, '/');
    1826         if ( $this->using_index_permalinks() )
    1827             $structure = ltrim($this->permalink_structure, $this->index . '/');
    1828         if ( 0 === strpos($structure, '%postname%') ||
    1829              0 === strpos($structure, '%category%') ||
    1830              0 === strpos($structure, '%tag%') ||
    1831              0 === strpos($structure, '%author%') )
     1825        if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) )
    18321826             $this->use_verbose_page_rules = true;
    18331827        else
Note: See TracChangeset for help on using the changeset viewer.