[wp-hackers] Getting post type object from singular label

Andrew Nacin wp at andrewnacin.com
Wed Jan 19 21:26:35 UTC 2011


On Wed, Jan 19, 2011 at 4:15 PM, Trent Martin <trentmar at gmail.com> wrote:

> I'm trying to get a post type name from it's singular label using
> get_post_types(), however the singular_label property was deprecated
> (Tickets #13357 and #14619).
>
> Is searching $wp_post_types->labels->singular_name the only way to do this
> now?


Yes. I wouldn't try to fetch a post type object/name from it's label though.
Curious as to the use case there. get_post_types() wasn't designed with that
in mind, as you can tell.

Nacin


More information about the wp-hackers mailing list