Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#14029 closed enhancement (worksforme)

custom post types: "page-attributes" should be "page-attributes"

Reported by: f-j-kaiser's profile F J Kaiser Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:


The only "-" used in custom post types is in "page-attributes". Everywhere else "_" is used. Assignes as minor.

Change History (6)

#1 @F J Kaiser
13 years ago

  • Cc 24-7@… added

Sorry. Misstyped the title:

"page-attributes" should be "page_attributes".

#2 @nacin
13 years ago

What are you comparing it to?

post_type_supports arguments include: custom-fields, page-attributes, and post-thumbnails. The 'supports' arg for register_post_type is simply a wrapper for register_post_type_support, which uses these slugs.

#3 @F J Kaiser
13 years ago

Comparing to a) all "parent" definitions/keys and b) all "child" (where the value is and array) definitions in "labels" and "capabilites". It's not major, but it feels strange and is a classic when it comes to bugtracking. I think it could better be an underline instead of the dash to stay in a line with the rest of the function.

#4 @nacin
13 years ago

For theme and post type support arguments, we consistently use hyphens. post-thumbnails is where it started (which was very widely publicized to theme developers and the like), and it continued for custom-fields and page-attributes. 'supports' is just a wrapper for register_post_type_support.

I agree it has the potential to be confusing, but it is separate in that these are not array keys, they are values. Capabilities are separated with underscores so if you set fine-grained capability control then you will use underscores; while supports arguments have been using hyphens for some time and therefore they will stay.

This is trivial, and the Codex and code documents this well, so I'm suggesting wontfix.

#5 @F J Kaiser
13 years ago

I know and understand it. I would just let it open as a note for "far in the future" RCs. That's why i set it to "minor". (But you can close it if you want. It's np.)

#6 @nacin
13 years ago

  • Milestone Unassigned deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Let's leave this as is. It's a valid point to make sure we're using consistent naming conventions and it's something we'll continue to consider in the future.

Note: See TracTickets for help on using tickets.