Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#26269 closed enhancement (invalid)

register_taxonomy should accept has_archive

Reported by: mattbeck's profile mattbeck Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:

Description

Taxonomies can and should be used by custom themes/plugins to connect posts/pages together.

It's not always desirable to expose this relationship publicly with an archive view, and if overlooked can cause undesired results or content duplication issues in search engine indexes.

Following the same process as registering a custom post type, the register_taxonomy function should accept the has_archive bool.

Change History (6)

#1 @nofearinc
11 years ago

What would be the difference with the has_archive argument for register_post_type calls?

#2 @mattbeck
11 years ago

Taxonomies are not always tied to a specific post type, and they have their own archive pages.

Those archive pages should be disable-able.

Currently if you don't want to expose the taxonomy's archive page, you have to set up a 301 or some such.

#3 @wonderboymusic
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

#4 @husobj
10 years ago

Related to #13816 ?

#5 follow-up: @nacin
10 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

The very concept of has_archive (as it applies to post types) doesn't exist for taxonomies. See #13816. If you want to suppress /tag/foo/ pages, you'll want to evaluate the rewrite and public args.

#6 in reply to: ↑ 5 @mattbeck
10 years ago

Replying to nacin:

The very concept of has_archive (as it applies to post types) doesn't exist for taxonomies. See #13816. If you want to suppress /tag/foo/ pages, you'll want to evaluate the rewrite and public args.

Gotcha, that wasn't clear.

Updated the codex to reflect this method.
http://codex.wordpress.org/Function_Reference/register_taxonomy#Example_Private_Taxonomy

Note: See TracTickets for help on using tickets.