[wp-hackers] Important changes to post type and taxonomy registration
Andrew Nacin
wp at andrewnacin.com
Thu May 13 15:53:57 UTC 2010
Testers and hackers,
We've made two important changes to how you register post types and
taxonomies. We've introduced two new arrays into the arguments you would
normally pass during registration: 'labels', and 'capabilities'.
More or less, label and singular_label is not enough for i18n purposes, so
we now generate a dozen or so labels based off the post type that can be
used throughout core, and any plugin can choose to register their own
translations for their own custom post types. (This also will apply to
taxonomies.) It isn't fully implemented yet, but it's close. We may
eliminate singular_label entirely, since that was introduced earlier in the
3.0 cycle.
Second, we've moved the fine-grained capabilities controls for custom post
types and taxonomies into a capabilities array. Thus, if you were using
manage_cap, assign_cap, edit_type_cap, etc -- all of those are gone, moved
under a cap object. ($post_type_object->cap->edit_posts.) Please take note.
I've also chronicled this in more detail (and arguably more confusing
fashion) at http://wpdevel.wordpress.com/?p=814. That post also references
the tickets where this was implemented, so you can look at the code if you
have any questions, or ping any of the committers etc.
Thanks,
Nacin
More information about the wp-hackers
mailing list