[wp-hackers] Default thumbnails for a custom post type

Carl Russmann crussmann at gmail.com
Fri Aug 24 16:18:38 UTC 2012

For the second time in as many months, I've found myself needing to set a
few defaults when creating a custom post type. Setting a default title and
content are straight-forward using the default_content and default_title

Is there a simple way to set a default thumbnail when the "New Post" UI
appears for the user?

What I've done for now is put this code into my filter for default_content.
If $post->ID isn't 0, set_post_thumbnail(...) is called, along with any
other post meta I'm setting as defaults on the new CPT. This seems to work,
but feels like the hack that it is.

I've been tracing through core, but can't see any other hooks or filters
that would be a more appropriate place to do this. Does anyone have any
suggestions  or a better way to do this?

Thanks a lot!

More information about the wp-hackers mailing list