Opened 2 years ago

Last modified 2 years ago

#17482 new enhancement

Formalize a list of "Object Types"

Reported by: mikeschinkel Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version:
Severity: normal Keywords: dev-feedback has-patch
Cc:

Description

I'm finding a need to use a defined list of object types for numerous things including for object relationships, term relationships that relate taxonomy terms to something other than a post, data entry forms, and I am sure there are more than just these requirements (An "object" is anything in WordPress for which we can identify a name and a unique ID form the database, i.e. $post->ID, $user->ID, $term->term_id and so on.)

While thinking about it this seems to be something that would be valuable to include core so I am proposing and submitting a patch for their potential inclusion. If this is not something that the team would want to include then I'll simply incorporate them into my own code but I wanted to make sure that the team wouldn't want to include them into WordPress core instead.

Attachments (2)

require-object-types.diff (449 bytes) - added by mikeschinkel 2 years ago.
Patch to /wp-settings.php to require object-types.php
object-types.php (1.7 KB) - added by mikeschinkel 2 years ago.
/wp-includes/object-types.php

Download all attachments as: .zip

Change History (5)

Patch to /wp-settings.php to require object-types.php

comment:1 follow-up: ↓ 3   scribu2 years ago

Shouldn't those be run through () ?

In general, we don't include strings that are not directly used in Core: #14972

Version 0, edited 2 years ago by scribu (next)

Yes, I realize that the strings aren't the main thing you're interested in.

comment:3 in reply to: ↑ 1   mikeschinkel2 years ago

Replying to scribu:

Shouldn't those be run through __() ?

In general, we don't include strings that are not directly used in Core: #14972

Great point, and fixing it caused me to realize I had forgotten something too, to make the values an array to enable support for future object type attributes. I'm uploading a patch to overwrite the first one.

/wp-includes/object-types.php

Note: See TracTickets for help on using tickets.