Make WordPress Core


Ignore:
Timestamp:
03/26/2008 06:37:19 AM (17 years ago)
Author:
ryan
Message:

Taxonomy links and template tags from andy. see #6357

File:
1 edited

Legend:

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

    r7493 r7520  
    462462    }
    463463
     464    function get_extra_permastruct($name) {
     465        if ( isset($this->extra_permastructs[$name]) )
     466            return $this->extra_permastructs[$name];
     467        return false;
     468    }
     469
    464470    function get_author_permastruct() {
    465471        if (isset($this->author_structure)) {
     
    833839
    834840        // Extra permastructs
    835         $extra_rewrite = array();
    836841        foreach ( $this->extra_permastructs as $permastruct )
    837             $extra_rewrite = array_merge($extra_rewrite, $this->generate_rewrite_rules($permastruct, EP_NONE));
     842            $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct, EP_NONE));
    838843
    839844        // Put them together.
    840845        if ( $this->use_verbose_page_rules )
    841             $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);
     846            $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);
    842847        else
    843             $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);
     848            $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);
    844849
    845850        do_action_ref_array('generate_rewrite_rules', array(&$this));
     
    955960    }
    956961
    957     function add_permastruct($struct, $with_front = true) {
     962    function add_permastruct($name, $struct, $with_front = true) {
    958963        if ( $with_front )
    959964            $struct = $this->front . $struct;
    960         $this->extra_permastructs[] = $struct;
     965        $this->extra_permastructs[$name] = $struct;
    961966    }
    962967
Note: See TracChangeset for help on using the changeset viewer.