#21050 closed enhancement (worksforme)
EP_TAXONOMY : Rewrite endpoints don't work for custom taxonomies
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Rewrite Rules | Keywords: | |
| Focuses: | Cc: |
Description
From what I can see and have tested, I simply cannot get a double custom taxonomy query to rewrite using endpoints.
Ex. http://domain.com/?taxonomy_name1=tax-slug-1&taxonomy_name2=tax-slug-2
If I add an endpoint:
add_rewrite_endpoint( 'taxonomy_name1', EP_NONE ); add_rewrite_endpoint( 'taxonomy_name1', EP_PERMALINKS ); add_rewrite_endpoint( 'taxonomy_name1', EP_ALL ); add_rewrite_endpoint( 'taxonomy_name1', EP_CATEGORIES );
None of these work. Instead I had to build out a new permastructure via add_permastruct().
However, EP_CATEGORIES (and thus EP_TAGS) both acted as expected. However, it would be great to be able to have EP_TAXONOMY that automatically built out the rewrite rules by adding the appropriate endpoint. Or is this too ambitious?
Change History (7)
#4
follow-up:
↓ 6
@
13 years ago
- Resolution set to worksforme
- Status changed from new to closed
UPDATE: this is either fixed and is no longer a problem, or resulted from a misunderstanding when calling register_taxonomy().
register_taxonomy() (see http://core.trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php#L314 ) defaults to 'ep_mask' => EP_NONE. The solution to this bug is to explicitly set the rewrite options and set 'ep_mask' => EP_TAGS or similar. rewrite.php (see http://core.trac.wordpress.org/browser/trunk/wp-includes/rewrite.php#L111 ) defines a number of masks, EP_TAGS, EP_CATEGORIES, and EP_ALL seem most useful.
I think I just found this bug myself.
Interestingly, http://site.net/customtaxonomy/termslug/feed/ works, while http://site.net/customtaxonomy/termslug/customendpoint/val/ does not.