Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20678 closed defect (bug) (invalid)

Custom post type 'name' is slug instead of plural label

Reported by: thomask's profile thomask Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:

Description

If you look into get_queried_object() object on build-in archive pages, the object->name contanins plural label of that categoriy, e.g. 'My news'.

If you do the same on CPT, it contains slug, e.g. "my-news"

The same is returned when you do post_type_archive_title() - so slug for CPT, Plural name for categories.

Change History (4)

#1 @thomask
12 years ago

sorry, the last sentence is wrong, post_type_archive_title returns it right (title, not slug)

#2 @scribu
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

You're comparing apples to oranges:

  • post type archive -> custom post type object
  • term archive -> term object (not taxonomy object)

If we had such a thing as taxonomy archives (#17567), 'name' would be the taxonomy slug, as expected.

Last edited 12 years ago by scribu (previous) (diff)

#3 @scribu
12 years ago

To clarify:

  • term archive: /categories/my-news/
  • taxonomy archive: /categories/ (not implemented)
Last edited 12 years ago by scribu (previous) (diff)

#4 @scribu
12 years ago

And no, it's too late to change 'name' to be consistent between term objects and CPT objects.

Note: See TracTickets for help on using tickets.