WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/23/2012 07:12:04 PM (9 years ago)
Author:
nacin
Message:

Add 'ep_mask' as an argument to the 'rewrite' array for register_post_type() and register_taxonomy(). Keeps 'permalink_epmask' compatible as an argument for post type registrations. Fixes endpoints for category and tag pages. fixes #19275.

File:
1 edited

Legend:

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

    r19730 r19738  
    2424                    'hierarchical' => true,
    2525                    'slug' => get_option('category_base') ? get_option('category_base') : 'category',
    26                     'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
     26                    'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true,
     27                    'ep_mask' => EP_CATEGORIES,
     28                ) : false,
    2729        'public' => true,
    2830        'show_ui' => true,
     
    3537        'rewrite' => did_action( 'init' ) ? array(
    3638                    'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
    37                     'with_front' => ( get_option('tag_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
     39                    'with_front' => ( get_option('tag_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true,
     40                    'ep_mask' => EP_TAGS,
     41                ) : false,
    3842        'public' => true,
    3943        'show_ui' => true,
     
    322326            'slug' => sanitize_title_with_dashes($taxonomy),
    323327            'with_front' => true,
    324             'hierarchical' => false
     328            'hierarchical' => false,
     329            'ep_mask' => EP_NONE,
    325330        ));
    326331
     
    331336
    332337        $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
    333         $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
     338        $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front'], $args['rewrite']['ep_mask'] );
    334339    }
    335340
Note: See TracChangeset for help on using the changeset viewer.