Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Note that this is not a question about how to change / edit a CPT's description. It's more about "why the heck is it provided?" because I haven't found anywhere either in the Admin back-end or the front end, where this description is actually shown.

What am I missing?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

There's not really a good usage of the description in WP. However, if you wish to extend the Wordpress functionality and use the description in your theme or plugins, it's available to you with the following:

global $wp_post_types;
$post_type = 'my_cpt';
$description = $wp_post_types[$post_type]->description;
share|improve this answer
2  
or $obj = get_post_type_object( 'some_posttype' ); $obj->description –  chrisguitarguy Sep 19 '11 at 18:35
1  
Two ways to skin a cat :) –  Brian Fegter Sep 19 '11 at 18:40
    
Thanks for the confirmation. I do prefer Christopher's approach, since it's more future-proof and allows for whatever added intelligence the core team may decide to implement in the future. A minor point of coding preference. Thanks @Brian for the answer. –  Tom Auger Sep 19 '11 at 20:47
    
I think I would concur Tom. :) –  Brian Fegter Sep 19 '11 at 23:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.