Make WordPress Core


Ignore:
Timestamp:
03/23/2008 05:02:11 PM (17 years ago)
Author:
ryan
Message:

Taxonomy queries and urls. Props andy. see #6357

File:
1 edited

Legend:

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

    r6964 r7491  
    831831        $page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite);
    832832
     833        // Extra permastructs
     834        $extra_rewrite = array();
     835        foreach ( $this->extra_permastructs as $permastruct )
     836            $extra_rewrite = array_merge($extra_rewrite, $this->generate_rewrite_rules($permastruct, EP_NONE));
     837
    833838        // Put them together.
    834839        if ( $this->use_verbose_page_rules )
    835             $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);
     840            $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, $extra_rewrite, $this->extra_rules);
    836841        else
    837             $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);
     842            $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, $extra_rewrite, $page_rewrite, $this->extra_rules);
    838843
    839844        do_action_ref_array('generate_rewrite_rules', array(&$this));
     
    949954    }
    950955
     956    function add_permastruct($struct, $with_front = true) {
     957        if ( $with_front )
     958            $struct = $this->front . $struct;
     959        $this->extra_permastructs[] = $struct;
     960    }
     961
    951962    function flush_rules() {
    952963        delete_option('rewrite_rules');
Note: See TracChangeset for help on using the changeset viewer.