WordPress.org

Make WordPress Core

Ticket #3614: 3614-page-after-filter.diff

File 3614-page-after-filter.diff, 1.3 KB (added by DD32, 10 years ago)

Add the catch-all page rules after the filtering is done to ensure custom rules are before

  • wp-includes/rewrite.php

     
    832832                if ( $this->use_verbose_page_rules )
    833833                        $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);
    834834                else
    835                         $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
     835                        $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);
    836836
    837837                do_action_ref_array('generate_rewrite_rules', array(&$this));
    838838                $this->rules = apply_filters('rewrite_rules_array', $this->rules);
    839839
     840                if ( ! $this->use_verbose_page_rules )
     841                        $this->rules = array_merge($this->rules, $page_rewrite);
     842
    840843                return $this->rules;
    841844        }
    842845