Ticket #6603: rewrite.patch

File rewrite.patch, 1.0 KB (added by emartin24, 4 years ago)

possible solution

  • rewrite.php

     
    18221822                $structure = ltrim($this->permalink_structure, '/'); 
    18231823                if ( $this->using_index_permalinks() ) 
    18241824                        $structure = ltrim($this->permalink_structure, $this->index . '/'); 
     1825 
     1826                //support for static posts page with custom permalink 
     1827                $static_permalink = ''; 
     1828                if (get_option('show_on_front')) { 
     1829                        $id = get_option('page_for_posts'); 
     1830                        if (!empty($id)) { 
     1831                                //get the page 
     1832                                $page = get_page($id); 
     1833                                 
     1834                                // use post_name for matching 
     1835                                $static_permalink = $page->post_name; 
     1836                        } 
     1837                } 
     1838 
    18251839                if ( 0 === strpos($structure, '%postname%') || 
    18261840                         0 === strpos($structure, '%category%') || 
    18271841                         0 === strpos($structure, '%tag%') || 
    1828                          0 === strpos($structure, '%author%') ) 
     1842                         0 === strpos($structure, '%author%') || 
     1843                         0 === strpos($structure, $static_permalink) ) 
    18291844                         $this->use_verbose_page_rules = true; 
    18301845                else 
    18311846                        $this->use_verbose_page_rules = false;