Created
October 2, 2012 19:38
-
-
Save alexkingorg/3822786 to your computer and use it in GitHub Desktop.
Add thumbnail support for a post type without stomping old types.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$thumbnails = get_theme_support('post-thumbnails'); | |
if (is_array($thumbnails)) { | |
add_theme_support('post-thumbnails', array_merge($thumbnails[0], array(self::$post_type))); | |
} | |
else if (!$thumbnails) { | |
add_theme_support('post-thumbnails', array(self::$post_type)); | |
} | |
// else already enabled for all post types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment